Skip to content

Commit

Permalink
Prove that create saves InatImport.inat_username
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCohen committed Jul 24, 2024
1 parent ad76eaf commit be34bbc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit be34bbc

Please sign in to comment.