Skip to content

Commit

Permalink
test bling_order_items_spec.rb: task #213
Browse files Browse the repository at this point in the history
add scenario for authorized and unauthorized customers for index action
  • Loading branch information
Pauloparakleto committed Mar 5, 2024
1 parent 9efe63c commit cfab622
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/requests/bling_order_items_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@
FactoryBot.create_list(:bling_order_item, 2, account_id: user.account.id)
end

context 'when there is no filter' do
before { get bling_order_items_path }
context 'when authorized' do
include_context 'with bling feature'

it 'is success' do
get bling_order_items_path
expect(response).to be_successful
end
end

context 'when unauthorized' do
it 'redirects to products path' do
get bling_order_items_path
expect(response).to redirect_to(products_path)
end
end
end

describe 'GET /show' do
Expand Down

0 comments on commit cfab622

Please sign in to comment.