Skip to content

Commit

Permalink
Update images_controller_test.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Jun 5, 2024
1 parent 666f749 commit 99bf823
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/controllers/observations/images_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,14 @@ def test_remove_image_by_id
assert(images.size > 1,
"Use Observation fixture with multiple images for best coverage")
user = obs.user
params = { id: obs.id, image_id: images.first.id }

login(user.login)

params = { id: obs.id, image_id: "bad_id" }
# It will just skip a bad image id.
put(:detach, params: params)
assert_equal(obs.images, obs.reload.images)

params[:image_id] = images.first.id
put(:detach, params: params)

assert_equal(obs.images.except(obs.images.first), obs.reload.images)
Expand Down

0 comments on commit 99bf823

Please sign in to comment.