From 5f45063ac9012581657de3f950fa5a5fe61eda5a Mon Sep 17 00:00:00 2001 From: Wendel Fabian Chinsamy Date: Fri, 22 Sep 2023 17:31:19 +0200 Subject: [PATCH] persist the doi fundingReferences schemUri value to the databse on create via the REST API --- app/lib/params_sanitizer.rb | 1 + spec/requests/datacite_dois_spec.rb | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/lib/params_sanitizer.rb b/app/lib/params_sanitizer.rb index cc2d84880..b90b24820 100644 --- a/app/lib/params_sanitizer.rb +++ b/app/lib/params_sanitizer.rb @@ -180,6 +180,7 @@ class ParamsSanitizer awardNumber awardUri awardTitle + schemeUri ], }, :geoLocations, diff --git a/spec/requests/datacite_dois_spec.rb b/spec/requests/datacite_dois_spec.rb index 4cb9ae5f6..8d720cc6a 100755 --- a/spec/requests/datacite_dois_spec.rb +++ b/spec/requests/datacite_dois_spec.rb @@ -1517,6 +1517,10 @@ "xml" => xml, "source" => "test", "event" => "publish", + "fundingReferences": [{ + "funderName": "fake_funder_name", + "schemeUri": "http://funder_uri" + }] }, }, } @@ -1527,7 +1531,7 @@ "type" => "dois", "attributes" => { "doi" => doi.doi, - }, + } }, } end @@ -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