Skip to content

Commit

Permalink
✅ Fix flaky work_show_presenter_spec
Browse files Browse the repository at this point in the history
This commit will ensure that the state of the test_strategy tenant is
returned to its default after the test runs because we were seeing this
interfere with other tests it was left set on non-default.
  • Loading branch information
kirkkwang committed Jan 14, 2025
1 parent 71dfcb5 commit 4eb1f53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/presenters/hyku/work_show_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
let(:request) { double(base_url: 'http://test.host', host: 'http://test.host') }
let(:ability) { nil }
let(:presenter) { described_class.new(solr_document, ability, request) }
let(:default_pdf_viewer_value) { Flipflop::FeatureSet.current.feature(:default_pdf_viewer).default }

describe "#manifest_url" do
subject { presenter.manifest_url }
Expand Down Expand Up @@ -39,6 +40,8 @@
let!(:test_strategy) { Flipflop::FeatureSet.current.test! }

before { allow_any_instance_of(Hyrax::IiifAv::IiifFileSetPresenter).to receive(:pdf?).and_return true }
# Return state of the tenant to the default after test suite
after { test_strategy.switch!(:default_pdf_viewer, default_pdf_viewer_value) }

context 'when the tenant is not configured to use IIIF Print' do
before { test_strategy.switch!(:default_pdf_viewer, true) }
Expand Down

0 comments on commit 4eb1f53

Please sign in to comment.