Skip to content

Commit

Permalink
persist the doi fundingReferences schemUri value to the databse on cr…
Browse files Browse the repository at this point in the history
…eate via the REST API
  • Loading branch information
wendelfabianchinsamy committed Sep 22, 2023
1 parent e541500 commit 5f45063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/lib/params_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class ParamsSanitizer
awardNumber
awardUri
awardTitle
schemeUri
],
},
:geoLocations,
Expand Down
7 changes: 6 additions & 1 deletion spec/requests/datacite_dois_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,10 @@
"xml" => xml,
"source" => "test",
"event" => "publish",
"fundingReferences": [{
"funderName": "fake_funder_name",
"schemeUri": "http://funder_uri"
}]
},
},
}
Expand All @@ -1527,7 +1531,7 @@
"type" => "dois",
"attributes" => {
"doi" => doi.doi,
},
}
},
}
end
Expand All @@ -1537,6 +1541,7 @@

expect(last_response.status).to eq(201)
expect(json.dig("data", "attributes", "titles")).to eq([{ "title" => "Eating your own Dog Food" }])
expect(json.dig("data", "attributes", "fundingReferences").first["schemeUri"]).to eq("http://funder_uri")
end

it "revert the changes" do
Expand Down

0 comments on commit 5f45063

Please sign in to comment.