diff --git a/test/controllers/observations/inat_imports_controller_test.rb b/test/controllers/observations/inat_imports_controller_test.rb index c738d3a1b5..d45b108781 100644 --- a/test/controllers/observations/inat_imports_controller_test.rb +++ b/test/controllers/observations/inat_imports_controller_test.rb @@ -38,6 +38,7 @@ def test_new_inat_import def test_import_authorization_request user = users(:rolf) + inat_username = "rolf" inat_import = inat_imports(:rolf_inat_import) assert_equal("Unstarted", inat_import.state, "Need a Unstarted inat_import fixture") @@ -50,13 +51,15 @@ def test_import_authorization_request "Authorization request to iNat shouldn't create MO Observation(s)" ) do post(:create, - params: { inat_ids: 123_456_789, inat_username: "rolf", + params: { inat_ids: 123_456_789, inat_username: inat_username, consent: 1 }) end assert_response(:redirect) assert_equal("Authorizing", inat_import.reload.state, "MO should be awaiting authorization from iNat") + assert_equal(inat_username, inat_import.inat_username, + "Failed to save InatImport.inat_username") end def test_import_missing_username