Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collection license persistence #445

Merged
merged 1 commit into from Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/models/collection.rb
Expand Up @@ -8,8 +8,10 @@ class Collection < ActiveFedora::Base
include Hyrax::BasicMetadata
self.indexer = Hyrax::CollectionWithBasicMetadataIndexer

property :license, predicate: ::RDF::Vocab::DC.rights, multiple: false

def self.multiple?(field)
if [:title, :description].include? field.to_sym
if [:title, :description, :license].include? field.to_sym
false
else
super
Expand Down
3 changes: 2 additions & 1 deletion spec/features/hyrax/collection_spec.rb
Expand Up @@ -10,7 +10,7 @@

describe 'collection show page' do
let(:collection) do
create(:public_collection, user: user, description: ['collection description'], collection_type_settings: :nestable)
create(:public_collection, user: user, license: 'http://creativecommons.org/licenses/by-nc-nd/4.0/', description: ['collection description'], collection_type_settings: :nestable)
end
let!(:work1) { create(:work, title: ["King Louie"], member_of_collections: [collection], user: user) }
let!(:work2) { create(:work, title: ["King Kong"], member_of_collections: [collection], user: user) }
Expand All @@ -29,6 +29,7 @@
it "shows a collection with a listing of Descriptive Metadata and catalog-style search results" do
expect(page).to have_content(collection.title.first)
expect(page).to have_content(collection.description.first)
expect(page).to have_content(collection.license.first)
expect(page).to have_content("Collection Details")
# Should not show title and description a second time
expect(page).not_to have_css('.metadata-collections', text: collection.title.first)
Expand Down