Skip to content

Commit

Permalink
refactor member_presenter_factory_spec to use Valkyrie for setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tamsin johnson committed Aug 23, 2023
1 parent db4d46b commit 253bc4d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/presenters/hyrax/member_presenter_factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 253bc4d

Please sign in to comment.