-
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.
use member_type instead of role_name in api. datacite/datacite#725
- Loading branch information
Martin Fenner
committed
May 24, 2019
1 parent
89e8b00
commit 0654f36
Showing
5 changed files
with
20 additions
and
30 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
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 |
---|---|---|
|
@@ -139,7 +139,7 @@ | |
end | ||
end | ||
|
||
context 'create provider type ROLE_CONTRACTUAL_PROVIDER ' do | ||
context 'create provider member_role contractual_provider' do | ||
let(:params) do | ||
{ "data" => { "type" => "providers", | ||
"attributes" => { | ||
|
@@ -148,7 +148,7 @@ | |
"region" => "EMEA", | ||
"contactEmail" => "[email protected]", | ||
"contactName" => "timAus", | ||
"roleName" => "ROLE_CONTRACTUAL_PROVIDER", | ||
"memberType" => "contractual_provider", | ||
"country" => "GB" } } } | ||
end | ||
|
||
|
@@ -157,16 +157,9 @@ | |
end | ||
|
||
it 'creates a provider' do | ||
puts json | ||
expect(json.dig('data', 'attributes', 'contactEmail')).to eq("[email protected]") | ||
expect(json.dig('data', 'attributes', 'name')).to eq("Figshare") | ||
end | ||
|
||
it 'provider model get computed' do | ||
report = Provider.where(symbol: json.dig('data', 'attributes','symbol')).first | ||
expect(report.role_name).to eq("ROLE_CONTRACTUAL_PROVIDER") | ||
expect(report.member_type).to eq("contractual_provider") | ||
expect(report.member_type_label).to eq("Contractual Provider") | ||
expect(json.dig('data', 'attributes', 'memberType')).to eq("contractual_provider") | ||
end | ||
|
||
it 'returns status code 201' do | ||
|