From ed6a639f02473b77af82e2197de66a9975f4a3ce Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 16 Oct 2020 19:07:15 +0200 Subject: [PATCH] fixed language in error message --- app/models/concerns/helpable.rb | 2 +- spec/concerns/helpable_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/helpable.rb b/app/models/concerns/helpable.rb index fde6ca2a5..348aa564a 100644 --- a/app/models/concerns/helpable.rb +++ b/app/models/concerns/helpable.rb @@ -22,7 +22,7 @@ def register_url end unless match_url_with_domains(url: url, domains: client.domains) - raise ActionController::BadRequest.new(), "[Handle] Error updating DOI " + doi + ": URL not allowed by client domains settings." + raise ActionController::BadRequest.new(), "[Handle] Error updating DOI " + doi + ": URL not allowed by repository domains settings." end unless is_registered_or_findable? diff --git a/spec/concerns/helpable_spec.rb b/spec/concerns/helpable_spec.rb index 17df3016f..8066d4808 100644 --- a/spec/concerns/helpable_spec.rb +++ b/spec/concerns/helpable_spec.rb @@ -167,19 +167,19 @@ it 'wrong domain' do client = create(:client, provider: provider, symbol: ENV['MDS_USERNAME'], password: ENV['MDS_PASSWORD'], domains: "example.org") subject = build(:doi, doi: "10.5438/mcnv-ga6n", url: "https://blog.datacite.org/", client: client, aasm_state: "findable") - expect { subject.register_url }.to raise_error(ActionController::BadRequest, "[Handle] Error updating DOI 10.5438/MCNV-GA6N: URL not allowed by client domains settings.") + expect { subject.register_url }.to raise_error(ActionController::BadRequest, "[Handle] Error updating DOI 10.5438/MCNV-GA6N: URL not allowed by repository domains settings.") end it 'wrong subdomain' do client = create(:client, provider: provider, symbol: ENV['MDS_USERNAME'], password: ENV['MDS_PASSWORD'], domains: "datacite.org") subject = build(:doi, doi: "10.5438/mcnv-ga6n", url: "https://blog.datacite.org/", client: client, aasm_state: "findable") - expect { subject.register_url }.to raise_error(ActionController::BadRequest, "[Handle] Error updating DOI 10.5438/MCNV-GA6N: URL not allowed by client domains settings.") + expect { subject.register_url }.to raise_error(ActionController::BadRequest, "[Handle] Error updating DOI 10.5438/MCNV-GA6N: URL not allowed by repository domains settings.") end it 'wildcard for subdomain but using naked domain' do client = create(:client, provider: provider, symbol: ENV['MDS_USERNAME'], password: ENV['MDS_PASSWORD'], domains: "*.datacite.org") subject = build(:doi, doi: "10.5438/mcnv-ga6n", url: "https://datacite.org/", client: client, aasm_state: "findable") - expect { subject.register_url }.to raise_error(ActionController::BadRequest, "[Handle] Error updating DOI 10.5438/MCNV-GA6N: URL not allowed by client domains settings.") + expect { subject.register_url }.to raise_error(ActionController::BadRequest, "[Handle] Error updating DOI 10.5438/MCNV-GA6N: URL not allowed by repository domains settings.") end it 'draft doi' do