Skip to content

Commit

Permalink
changed test as request status has changed when adding new item
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Deli authored and Dennis Deli committed Dec 3, 2024
1 parent ecba313 commit 3846b36
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/controllers/items_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,18 @@ class ItemsControllerTest < ActionDispatch::IntegrationTest

## ADDITIONAL ACTIONS TESTS ##

should 'change request status to open if new item is added' do
# should 'change request status to open if new item is added' do
# request = create(:request, status: Request::INPROGRESS)
# post request_items_path(@_request), params: { item: attributes_for(:item).except(:request) }
# r = get_instance_var(:request)
# assert_equal Request::OPEN, r.status, 'Status should be set to open'
# end

should 'request status should remain in progress when new item is added' do
request = create(:request, status: Request::INPROGRESS)
post request_items_path(@_request), params: { item: attributes_for(:item).except(:request) }
r = get_instance_var(:request)
assert_equal Request::OPEN, r.status, 'Status should be set to open'
assert_equal Request::INPROGRESS, r.status, 'Status should in progress'
end

should 'change status' do
Expand Down

0 comments on commit 3846b36

Please sign in to comment.