Skip to content

Commit

Permalink
handle software label in apa style. datacite/bolognese#95
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jun 24, 2020
1 parent 09bfb69 commit f59ff2c
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/api/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,13 @@
expect(last_response.body).to start_with("M. Sankar, K. Nieminen")
end

it "header with style software apa" do
doi = "10.21373/1572872428618"
get "/#{doi}", nil, { "HTTP_ACCEPT" => "text/x-bibliography; style=apa" }
expect(last_response.status).to eq(200)
expect(last_response.body).to eq("Miller, E. (2014). <i>Full DataCite XML Example</i> (Version 4.2) [Computer software]. DataCite. https://doi.org/10.21373/1572872428618")
end

it "header with style and locale" do
get "/#{doi}", nil, { "HTTP_ACCEPT" => "text/x-bibliography; style=vancouver; locale=de" }
expect(last_response.status).to eq(200)
Expand Down Expand Up @@ -1052,6 +1059,13 @@
expect(last_response.status).to eq(200)
expect(last_response.body).to eq("Ebihara, A., Nakato, N., Kuo, L.-Y., Miyazaki, H., &amp; Serizawa, S. (2019). Allopolyploid Origin and Distribution Range of <i>Acystopteris taiwaniana </i>(Cystopteridaceae: Polypodiales). In <i>Acta phytotaxonomica et geobotanica</i> (Vol. 70, pp. 19–28). The Japanese Society for Plant Systematics. https://doi.org/10.18942/apg.201812")
end

it "link with style" do
get "/text/x-bibliography/#{doi}?style=ieee"

expect(last_response.status).to eq(200)
expect(last_response.body).to start_with("A. Ebihara, N. Nakato")
end
end

context "unknown accept header" do
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f59ff2c

Please sign in to comment.