spec/api_spec.rb in cirneco-0.7.4 vs spec/api_spec.rb in cirneco-0.8.1
- old
+ new
@@ -26,10 +26,19 @@
media: media,
username: username,
password: password) }
describe "Metadata API" do
+ context "post" do
+ it 'should post metadata' do
+ response = subject.post_metadata(subject.data, options)
+ expect(response.body["data"]).to eq("OK (10.5072/0000-03VC)")
+ expect(response.status).to eq(201)
+ expect(response.headers["Location"]).to eq("http://mds-sandbox.datacite.org/metadata/10.5072/0000-03VC")
+ end
+ end
+
context "get" do
it 'should get metadata' do
response = subject.get_metadata(doi, options)
expect(response.body["data"]).to eq(subject.data)
end
@@ -40,19 +49,10 @@
response = subject.delete_metadata(doi, options)
expect(response.body["data"]).to eq("OK")
expect(response.status).to eq(200)
end
end
-
- context "post" do
- it 'should post metadata' do
- response = subject.post_metadata(subject.data, options)
- expect(response.body["data"]).to eq("OK (10.5072/0000-03VC)")
- expect(response.status).to eq(201)
- expect(response.headers["Location"]).to eq("https://mds.test.datacite.org/metadata/10.5072/0000-03VC")
- end
- end
end
describe "DOI API" do
describe "put" do
it 'should put doi' do
@@ -64,10 +64,10 @@
describe "get" do
it 'should get all dois' do
response = subject.get_dois(options)
dois = response.body["data"]
- expect(dois.length).to eq(13)
+ expect(dois.length).to eq(504)
expect(dois.first).to eq("10.23725/0000-03VC")
end
it 'should get doi' do
response = subject.get_doi(doi, options)