Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 10, 2019
1 parent ff6b4f9 commit 2bb9165
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spec/requests/dois_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,8 @@
end
before { patch "/dois/10.14454/10703", params: valid_attributes.to_json, headers: headers }

it 'updates the record' do
expect(json.dig('data', 'attributes', 'doi')).to eq("10.14454/10703")
expect(json.dig('data', 'attributes', 'url')).to eq("http://www.bl.uk/pdf/patspec.pdf")
expect(json.dig('data', 'attributes', 'titles')).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
expect(json.dig('data', 'attributes', 'schemaVersion')).to eq("http://datacite.org/schema/kernel-2.2")

xml = Maremma.from_xml(Base64.decode64(json.dig('data', 'attributes', 'xml'))).fetch("resource", {})
expect(xml.dig("titles", "title")).to eq(["Właściwości rzutowań podprzestrzeniowych", {"__content__"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
it 'returns status code 422' do
expect(response).to have_http_status(422)
end

it 'returns an error that schema is no longer supported' do
Expand Down

0 comments on commit 2bb9165

Please sign in to comment.