-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #872 from datacite/fabrica-improvements-10
Changes to support Fabrica Improvements feature 10
- Loading branch information
Showing
5 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -872,6 +872,48 @@ | |
end | ||
end | ||
|
||
context "create provider with internationalOrganization organization type" do | ||
provider_symbol = "FG" | ||
let(:params) do | ||
{ | ||
"data" => { | ||
"type" => "providers", | ||
"attributes" => { | ||
"symbol" => provider_symbol, | ||
"name" => "Figshare", | ||
"displayName" => "Figshare", | ||
"region" => "EMEA", | ||
"systemEmail" => "[email protected]", | ||
"website" => "https://www.bl.uk", | ||
"memberType" => "direct_member", | ||
"organizationType" => "internationalOrganization", | ||
"country" => "GB", | ||
}, | ||
}, | ||
} | ||
end | ||
|
||
it "creates a provider" do | ||
post "/providers", params, admin_headers | ||
|
||
expect(last_response.status).to eq(200) | ||
expect(json.dig("data", "attributes", "organizationType")).to eq( | ||
"internationalOrganization", | ||
) | ||
|
||
sleep 1 | ||
|
||
get "/providers/#{ | ||
provider_symbol | ||
}", | ||
nil, headers | ||
|
||
expect(json.dig("data", "attributes", "organizationType")).to eq( | ||
"internationalOrganization", | ||
) | ||
end | ||
end | ||
|
||
context "when the request is missing a required attribute" do | ||
let(:params) do | ||
{ | ||
|
@@ -937,6 +979,7 @@ | |
"globusUuid" => "9908a164-1e4f-4c17-ae1b-cc318839d6c8", | ||
"displayName" => "British Library", | ||
"memberType" => "consortium_organization", | ||
"organizationType" => "internationalOrganization", | ||
"website" => "https://www.bl.uk", | ||
"region" => "Americas", | ||
"systemEmail" => "[email protected]", | ||
|
@@ -966,6 +1009,9 @@ | |
expect( | ||
json.dig("data", "relationships", "consortium", "data", "id"), | ||
).to eq(consortium.symbol.downcase) | ||
expect(json.dig("data", "attributes", "organizationType")).to eq( | ||
"internationalOrganization", | ||
) | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
"name" => "Imperial College", | ||
"systemEmail" => "[email protected]", | ||
"salesforceId" => "abc012345678901234", | ||
"software" => "MyCoRe", | ||
"fromSalesforce" => true, | ||
"clientType" => "repository", | ||
"certificate" => %w[CoreTrustSeal], | ||
|
@@ -125,6 +126,7 @@ | |
expect(json.dig("data", "attributes", "globusUuid")).to eq( | ||
"bc7d0274-3472-4a79-b631-e4c7baccc667", | ||
) | ||
expect(json.dig("data", "attributes", "software")).to eq(client.software) | ||
expect(json["meta"]).to eq("doiCount" => 0, "prefixCount" => 0) | ||
end | ||
end | ||
|
@@ -240,6 +242,7 @@ | |
expect(attributes["name"]).to eq("Imperial College") | ||
expect(attributes["systemEmail"]).to eq("[email protected]") | ||
expect(attributes["certificate"]).to eq(%w[CoreTrustSeal]) | ||
expect(attributes["software"]).to eq("MyCoRe") | ||
expect(attributes["salesforceId"]).to eq("abc012345678901234") | ||
|
||
relationships = json.dig("data", "relationships") | ||
|
@@ -322,6 +325,7 @@ | |
"name" => "Imperial College 2", | ||
"clientType" => "periodical", | ||
"globusUuid" => "9908a164-1e4f-4c17-ae1b-cc318839d6c8", | ||
"software" => "OPUS" | ||
}, | ||
}, | ||
} | ||
|
@@ -337,6 +341,9 @@ | |
expect(json.dig("data", "attributes", "globusUuid")).to eq( | ||
"9908a164-1e4f-4c17-ae1b-cc318839d6c8", | ||
) | ||
expect(json.dig("data", "attributes", "software")).to eq( | ||
"OPUS", | ||
) | ||
expect(json.dig("data", "attributes", "name")).not_to eq(client.name) | ||
expect(json.dig("data", "attributes", "clientType")).to eq("periodical") | ||
end | ||
|