From 253bc4dacbc9d2449a27433f2f15f9aa1d318a69 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Tue, 22 Aug 2023 22:04:55 -0700 Subject: [PATCH] refactor `member_presenter_factory_spec` to use Valkyrie for setup --- spec/presenters/hyrax/member_presenter_factory_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/presenters/hyrax/member_presenter_factory_spec.rb b/spec/presenters/hyrax/member_presenter_factory_spec.rb index 41786fab1c..0c928f686f 100644 --- a/spec/presenters/hyrax/member_presenter_factory_spec.rb +++ b/spec/presenters/hyrax/member_presenter_factory_spec.rb @@ -18,15 +18,16 @@ end it 'builds presenters for the object ids passed in' do - ids = FactoryBot.create_list(:work, 2).map(&:id) + ids = [FactoryBot.valkyrie_create(:hyrax_work).id, + FactoryBot.valkyrie_create(:hyrax_work).id] expect(factory.member_presenters(ids)) .to contain_exactly(*ids.map { |id| have_attributes(id: id) }) end context 'with members' do - let(:work) { FactoryBot.create(:work_with_file_and_work) } - let(:attributes) { work.to_solr } + let(:work) { FactoryBot.valkyrie_create(:hyrax_work, :with_member_works_and_file_sets) } + let(:attributes) { Hyrax::ValkyrieIndexer.for(resource: work).to_solr } it 'builds presenters for the memebers' do expect(factory.member_presenters)