Skip to content

Commit

Permalink
Test updating nonexistent project
Browse files Browse the repository at this point in the history
Gets 100% coverage of ViolationsController
  • Loading branch information
JoeCohen committed Mar 17, 2024
1 parent 2b8ecf2 commit 849d7c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/controllers/projects/violations_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,16 @@ def test_update
assert_not_includes(project.observations, nybg_2023_09_obs,
"Failed to remove checked violation from Project")
end

def test_update_nonexistent_project
id = observations(:minimal_unknown_obs).id
nybg_2023_09_obs = observations(:nybg_2023_09_obs)
params = { project_id: id,
project: { "remove_#{nybg_2023_09_obs.id}" => "1" } }
login
post(:update, params: params)

assert_redirected_to(projects_path)
end
end
end

0 comments on commit 849d7c1

Please sign in to comment.