Skip to content

Commit

Permalink
make hyrax_helper_spec pass on .koppie
Browse files Browse the repository at this point in the history
`#thumbnail_label_for` specs dependeded on ActiveFedora. these tests
specifically check integration with older Form objects. instead of removing or
refactoring the old tests at this point, mark them as `:active_fedora` and
introduce a new test that checks the method contract more generally.
  • Loading branch information
tamsin johnson authored and tamsin johnson committed Aug 29, 2023
1 parent 2f19386 commit 8df32b0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spec/helpers/hyrax_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ def new_state

RSpec.describe HyraxHelper, type: :helper do
describe "show_transfer_request_title" do
let(:sender) { create(:user) }
let(:user) { create(:user) }
let(:sender) { FactoryBot.create(:user) }
let(:user) { FactoryBot.create(:user) }

context "when work is canceled" do
let(:request) do
Expand Down Expand Up @@ -395,7 +395,14 @@ def new_state
expect(helper.thumbnail_label_for(object: Object.new)).to be_a String
end

it 'interoperates with CollectionForm' do
it 'interoperates with display objects with #thumbnail_title' do
model_or_presenter_or_form = double(thumbnail_title: 'my display thumbnail title')

expect(helper.thumbnail_label_for(object: model_or_presenter_or_form))
.to eq 'my display thumbnail title'
end

it 'interoperates with CollectionForm', :active_fedora do
collection = ::Collection.new
collection.thumbnail = ::FileSet.create(title: ["thumbnail"])

Expand All @@ -406,7 +413,7 @@ def new_state
expect(helper.thumbnail_label_for(object: form)).to eq 'thumbnail'
end

it 'interoperates with AdminSetForm' do
it 'interoperates with AdminSetForm', :active_fedora do
admin_set = AdminSet.new
admin_set.thumbnail = ::FileSet.create(title: ["thumbnail"])

Expand Down

0 comments on commit 8df32b0

Please sign in to comment.