Skip to content

Commit

Permalink
Fix by_resource_type_spec.rb when using Valkyrie
Browse files Browse the repository at this point in the history
  • Loading branch information
abelemlih authored and tamsin johnson committed Oct 26, 2023
1 parent c728f53 commit bd6696f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions spec/services/hyrax/statistics/works/by_resource_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

describe "#query", :clean_repo do
before do
# Creating factories here led to failures found within
# https://travis-ci.org/samvera/hyrax/jobs/454752377
# One should be able to invoke create(:generic_work)...
# ...however, there are difficulties here which relate to the "terms"
# requestHandler
# @see https://github.com/samvera/hyrax/issues/3491
GenericWork.create(title: ['test'], resource_type: ['Conference Proceeding']).save!
GenericWork.create(title: ['test'], resource_type: ['Conference Proceeding']).save!
GenericWork.create(title: ['test'], resource_type: ['Image']).save!
GenericWork.create(title: ['test'], resource_type: ['Journal']).save!
if Hyrax.config.use_valkyrie?
FactoryBot.valkyrie_create(:monograph, title: ['test 1'], resource_type: ['Conference Proceeding'])
FactoryBot.valkyrie_create(:monograph, title: ['test 2'], resource_type: ['Conference Proceeding'])
FactoryBot.valkyrie_create(:monograph, title: ['test 3'], resource_type: ['Image'])
FactoryBot.valkyrie_create(:monograph, title: ['test 4'], resource_type: ['Journal'])
else
GenericWork.create(title: ['test 1'], resource_type: ['Conference Proceeding']).save!
GenericWork.create(title: ['test 2'], resource_type: ['Conference Proceeding']).save!
GenericWork.create(title: ['test 3'], resource_type: ['Image']).save!
GenericWork.create(title: ['test 4'], resource_type: ['Journal']).save!
end
end

subject { service.query }
Expand Down

0 comments on commit bd6696f

Please sign in to comment.