Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/datacite/lupo
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Aug 4, 2019
2 parents 50f72ff + b5982b9 commit 75834ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ def safe_params
{ dates: [:date, :dateType, :dateInformation] },
:subjects,
{ subjects: [:subject, :subjectScheme, :schemeUri, :valueUri, :lang] },
:landingPage,
{
landingPage: [
:checked,
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/dois_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,13 @@
expect(json.dig('data', 'attributes', 'landingPage')).to eq(landing_page)
expect(json.dig('data', 'attributes', 'state')).to eq("findable")
end

it 'fails to create a doi with bad data' do
valid_attributes['data']['attributes']['landingPage'] = "http://example.com"
post '/dois', valid_attributes.to_json, { 'HTTP_ACCEPT'=>'application/vnd.api+json', 'CONTENT_TYPE'=>'application/vnd.api+json', 'HTTP_AUTHORIZATION' => 'Bearer ' + bearer }

expect(last_response.status).to eq(422)
end
end

context 'update with landing page info as admin' do
Expand Down

0 comments on commit 75834ec

Please sign in to comment.