From 8d84eaac28423b75d7836754f0733055c45043c5 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Fri, 28 Jan 2022 13:49:54 -0800 Subject: [PATCH] AdministrativeSet#description should be single-valued related to #5385. --- app/models/hyrax/administrative_set.rb | 2 +- .../hyrax/forms/administrative_set_form_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/models/hyrax/administrative_set.rb b/app/models/hyrax/administrative_set.rb index b00661926e..b34af2bef1 100644 --- a/app/models/hyrax/administrative_set.rb +++ b/app/models/hyrax/administrative_set.rb @@ -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 diff --git a/spec/forms/hyrax/forms/administrative_set_form_spec.rb b/spec/forms/hyrax/forms/administrative_set_form_spec.rb index f054ec338a..8100f0cb16 100644 --- a/spec/forms/hyrax/forms/administrative_set_form_spec.rb +++ b/spec/forms/hyrax/forms/administrative_set_form_spec.rb @@ -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! }