Skip to content

Commit

Permalink
Conform LifeformsControllersTest params to updated form
Browse files Browse the repository at this point in the history
- Fixes bug in test:
```ruby
 FAIL Names::LifeformsControllerTest#test_edit_lifeform (159.03s)
        Expected: " lichenicolous "
          Actual: " "
        test/controllers/names/lifeforms_controller_test.rb:26:in `test_edit_lifeform'
```
- Lifeform form now uses params[:lifeform][:<form>] rather than params[:lifeform_<form>]
  • Loading branch information
JoeCohen committed Jan 10, 2024
1 parent fd2359b commit f886dae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/controllers/names/lifeforms_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def test_edit_lifeform
end

# Make sure user can both add and remove lifeform categories.
params = { id: name.id }
params = { id: name.id, lifeform: {} }
Name.all_lifeforms.each do |word|
params["lifeform_#{word}"] = (word == "lichenicolous" ? "1" : "")
params[:lifeform][word] = (word == "lichenicolous" ? "1" : "")
end
put(:update, params: params)
assert_equal(" lichenicolous ", name.reload.lifeform)
Expand Down

0 comments on commit f886dae

Please sign in to comment.