spec/unit/datacite/mapping/rights_spec.rb in datacite-mapping-0.1.16 vs spec/unit/datacite/mapping/rights_spec.rb in datacite-mapping-0.1.17

- old
+ new

@@ -68,9 +68,19 @@ it 'writes XML' do rights = Rights.new(value: 'CC0 1.0 Universal', uri: URI('http://creativecommons.org/publicdomain/zero/1.0/')) expected_xml = '<rights rightsURI="http://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0 Universal</rights>' expect(rights.save_to_xml).to be_xml(expected_xml) end + it 'works with convenience constants' do + rights = Rights::CC_ZERO + expected_xml = '<rights rightsURI="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0 Universal (CC0 1.0) Public Domain Dedication</rights>' + expect(rights.save_to_xml).to be_xml(expected_xml) + + rights = Rights::CC_BY + expected_xml = '<rights rightsURI="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International (CC-BY)</rights>' + expect(rights.save_to_xml).to be_xml(expected_xml) + end + end end end end