Skip to content

Commit

Permalink
🧹 Rely on test strategy instead of UI hack
Browse files Browse the repository at this point in the history
Prior to this commit we were relying on a SHA; one that looks like it
might not be all that durable.

With this commit, we instead favor using a test strategy to turn it on.
  • Loading branch information
jeremyf committed Dec 15, 2023
1 parent 9b88c98 commit 4117926
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions spec/features/admin_dashboard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
context 'as an administrator' do
let(:user) { FactoryBot.create(:admin) }
let(:group) { FactoryBot.create(:group) }
let!(:test_strategy) { Flipflop::FeatureSet.current.test! }

before do
test_strategy.switch(:show_workflow_roles_menu_item_in_admin_dashboard_sidebar, true)
login_as(user, scope: :user)
end

Expand Down Expand Up @@ -46,14 +48,9 @@
expect(page).to have_link('Available Work Types')
click_link "Features"
end
# TODO: I (Jeremy) commented out the code, because I find it hard to imagine that the
# e12067c3ac367d4bb2798ab71fbb8660 is a durable value for tests.
#
# the workflow roles button is only ever shown if the setting is turned on.
# within("form[action='/admin/features/show_workflow_roles_menu_item_in_admin_dashboard_sidebar/strategies/e12067c3ac367d4bb2798ab71fbb8660?locale=en']") do
# find("input[value='on']").click
# end
# expect(page).to have_link('Workflow Roles')
# see before block for enabling the feature
expect(page).to have_link('Workflow Roles')
end

it 'shows the status page' do
Expand Down

0 comments on commit 4117926

Please sign in to comment.