Skip to content

Commit

Permalink
Edit catalog_search_spec.rb for Valkyrie compatibility (#6443)
Browse files Browse the repository at this point in the history
* Edit catalog_search_spec.rb for Valkyrie compatibility

* Edit catalog_search_spec.rb
  • Loading branch information
abelemlih authored Nov 15, 2023
1 parent 72619ea commit 4b484e9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions spec/features/catalog_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@

context 'with works and collections' do
let!(:jills_work) do
create(:public_work, title: ["Jill's Research"], keyword: ['jills_keyword', 'shared_keyword'])
FactoryBot.valkyrie_create(:monograph, :public, title: ["Jill's Research"], keyword: ['jills_keyword', 'shared_keyword'])
end

let!(:jacks_work) do
create(:public_work, title: ["Jack's Research"], keyword: ['jacks_keyword', 'shared_keyword'])
FactoryBot.valkyrie_create(:monograph, :public, title: ["Jack's Research"], keyword: ['jacks_keyword', 'shared_keyword'])
end

let!(:collection) { create(:public_collection_lw, keyword: ['collection_keyword', 'shared_keyword']) }
let!(:collection) do
FactoryBot.valkyrie_create(:collection_resource, :public, keyword: ['collection_keyword', 'shared_keyword'])
end

it 'performing a search' do
within('#search-form-header') do
Expand All @@ -31,10 +33,12 @@
end

context 'with public works and private collections', clean_repo: true do
let!(:collection) { build(:private_collection_lw) }
let!(:collection) do
FactoryBot.valkyrie_create(:collection_resource, members: [jills_work])
end

let!(:jills_work) do
create(:public_work, title: ["Jill's Research"], keyword: ['jills_keyword'], member_of_collections: [collection])
FactoryBot.valkyrie_create(:monograph, :public, title: ["Jill's Research"], keyword: ['jills_keyword'])
end

it "hides collection facet values the user doesn't have access to view when performing a search" do
Expand Down

0 comments on commit 4b484e9

Please sign in to comment.