Skip to content

Commit

Permalink
Merge pull request #1008 from datacite/persist-doi-funding-references…
Browse files Browse the repository at this point in the history
…-schemeuri

persist the doi fundingReferences schemUri on create via REST API
  • Loading branch information
wendelfabianchinsamy authored Sep 28, 2023
2 parents e541500 + 5f45063 commit 1e1c746
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 1e1c746

Please sign in to comment.