diff --git a/spec/models/doi_spec.rb b/spec/models/doi_spec.rb index 19dd24bce..d7d692e9d 100644 --- a/spec/models/doi_spec.rb +++ b/spec/models/doi_spec.rb @@ -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