Skip to content

Commit

Permalink
Extend test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszreszke committed Sep 24, 2024
1 parent 58db4d2 commit c357f39
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rails_application/test/integration/orders_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ def test_happy_path

assert_remove_buttons_not_visible(async_remote_id, fearless_id)

post "/orders/#{order_id}/add_item?product_id=#{async_remote_id}"
post "/orders/#{order_id}/add_item?product_id=#{fearless_id}"
post "/orders/#{order_id}/add_item?product_id=#{fearless_id}"
assert_changes -> { Product.find(async_remote_id).stock_level }, from: 10, to: 9 do
post "/orders/#{order_id}/add_item?product_id=#{async_remote_id}"
end

assert_changes -> { Product.find(fearless_id).stock_level }, from: 10, to: 8 do
post "/orders/#{order_id}/add_item?product_id=#{fearless_id}"
post "/orders/#{order_id}/add_item?product_id=#{fearless_id}"
end
get "/orders/#{order_id}/edit"
assert_remove_buttons_visible(async_remote_id, fearless_id, order_id)

Expand Down

0 comments on commit c357f39

Please sign in to comment.