Skip to content

Commit

Permalink
add rights_list test. #691
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 22, 2020
1 parent baf6596 commit e77ab6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/models/doi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@
expect(doi.errors.details).to eq(rights_list: [{ error: "Rights should not have a length of more than 2000 characters." }])
end

it "nil rights" do
doi.rights_list = [{ "rights" => nil }]
expect(doi.save).to be true
expect(doi.errors.details).to be_empty
expect(doi.rights_list).to eq([])
end

it "hash rightsIdentifier" do
doi.rights_list = [{ "rightsIdentifier" => "CC-BY-4.0" }]
expect(doi.save).to be true
Expand Down

0 comments on commit e77ab6a

Please sign in to comment.