Skip to content

Commit

Permalink
AdministrativeSet#description should be single-valued
Browse files Browse the repository at this point in the history
related to #5385.
  • Loading branch information
tamsin johnson authored and tamsin johnson committed Jan 31, 2022
1 parent f01616d commit 8d84eaa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/hyrax/administrative_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AdministrativeSet < Hyrax::Resource

attribute :alternative_title, Valkyrie::Types::Set.of(Valkyrie::Types::String)
attribute :creator, Valkyrie::Types::Set.of(Valkyrie::Types::String)
attribute :description, Valkyrie::Types::Set.of(Valkyrie::Types::String)
attribute :description, Valkyrie::Types::String

##
# @return [Boolean] true
Expand Down
16 changes: 16 additions & 0 deletions spec/forms/hyrax/forms/administrative_set_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
end
end

describe '#description' do
it 'is a single value' do
form.description = 'moomin'

expect { form.sync }
.to change { admin_set.description }
.to eq 'moomin'
end

it 'is a single value on repopulate' do
admin_set.description = 'moomin'

expect(form).to have_attributes(description: 'moomin')
end
end

describe '#member_ids' do
it 'populates as empty' do
expect { form.prepopulate! }
Expand Down

0 comments on commit 8d84eaa

Please sign in to comment.