Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lifeforms followup #1788

Merged
merged 9 commits into from
Jan 10, 2024
Merged

Lifeforms followup #1788

merged 9 commits into from
Jan 10, 2024

Conversation

JoeCohen
Copy link
Member

@JoeCohen JoeCohen commented Jan 10, 2024

Fixes #1787

  • Fixes bug in updating Lifeform
  • Fixes propagating Lifeform

- And conform expectation to added Name
Test fails becuause of pre-existing issue in form
```ruby
% rails t test/integration/capybara/names_integration_test.rb -n test_lifeform
...
ERROR NamesIntegrationTest#test_lifeform (5.31s)
Minitest::UnexpectedError:         ActionController::RoutingError: No route matches [POST] "/names/832367622/lifeforms/propagate"
            test/integration/capybara/names_integration_test.rb:126:in `test_lifeform'
```
- Specity :put as form method, fixing bug that caused routing error
- Reloads object in species, fixing bug in test
- Adds error message to assertion
- Renames test
Fixes this test failure:
```ruby
% rails t test/models/api2_test.rb:1772
Started with run options --seed 23500

 FAIL API2Test#test_getting_names (1.62s)
        API2 results wrong.
        Query args: {:by=>"id", :misspellings=>:no, :names=>["271247339"], :include_subtaxa=>true, :exclude_original_names=>true}
        Query sql:
              SELECT DISTINCT names.id
              FROM `names`
              WHERE names.id IN (80895585,139785830,158828821,230704064,265698276,288002050,294699169,296421830,315940267,393515326,456981406,501140881,540213941,545255341,547603516,561573041,651545465,668214189,698443452,743294091,815653499,832367622,984734592,1041241452,1042698304,1073463617) AND names.correct_spelling_id IS NULL
          ORDER BY names.id ASC
        .
        --- expected
        +++ actual
        @@ -1 +1 @@
        -["<agaricaceae>", "<agaricales>", "<agaricus>", "<agaricus_campestras>", "<agaricus_campestris>", "<agaricus_campestros>", "<agaricus_campestrus>", "<ascomycetes>", "<ascomycota>", "<basidiomycetes>", "<basidiomycota>", "<chlorophyllum>", "<chlorophyllum_rachodes>", "<chlorophyllum_rhacodes>", "<coprinus>", "<coprinus_comatus>", "<lecanorales>", "<lepiota>", "<lepiota_rachodes>", "<lepiota_rhacodes>", "<peltigera>", "<peltigeraceae>", "<sect_agaricus>", "<tremella>", "<tremella_celata>", "<tremella_justpublished>", "<tremella_mesenterica>"]
        +["<agaricaceae>", "<agaricales>", "<agaricus>", "<agaricus_campestras>", "<agaricus_campestris>", "<agaricus_campestros>", "<agaricus_campestrus>", "<ascomycetes>", "<ascomycota>", "<basidiomycetes>", "<basidiomycota>", "<chlorophyllum>", "<chlorophyllum_rachodes>", "<chlorophyllum_rhacodes>", "<coprinus>", "<coprinus_comatus>", "<lecanorales>", "<lepiota>", "<lepiota_rachodes>", "<lepiota_rhacodes>", "<peltigera>", "<peltigeraceae>", "<sect_agaricus>", "<tremella>", "<tremella_celata>"]
        test/general_extensions.rb:192:in `assert_arrays_equal'
        test/general_extensions.rb:200:in `assert_obj_arrays_equal'
        test/models/api2_test.rb:58:in `assert_api_results'
        test/models/api2_test.rb:1772:in `test_getting_names'
```
- 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>]
@JoeCohen JoeCohen marked this pull request as ready for review January 10, 2024 04:32
@JoeCohen JoeCohen merged commit 0aea2da into main Jan 10, 2024
5 checks passed
@JoeCohen JoeCohen deleted the jdc-lifeforms-followup-1787 branch January 10, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newly exposed lifeform issues
1 participant