Skip to content

Commit 11c7bd0

Browse files
committed
refactor: simplify setup wizard completion spec by removing unnecessary user login and redirect follow
1 parent e3c2d8b commit 11c7bd0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spec/requests/better_together/wizard_completion_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22

33
require 'rails_helper'
44

5-
RSpec.describe 'Setup Wizard completion', type: :request do
6-
let!(:platform) { create(:better_together_platform, :host, privacy: 'private') }
5+
RSpec.describe 'Setup Wizard completion' do
76
let!(:wizard) { BetterTogether::Wizard.find_by!(identifier: 'host_setup') }
8-
let!(:user) { create(:better_together_user, :confirmed, :platform_manager) }
97

108
before do
119
wizard.mark_completed
12-
login_as(user, scope: :user)
1310
end
1411

1512
it 'redirects to the success path with notice preserved' do
1613
get better_together.setup_wizard_path(locale: I18n.locale)
1714
expect(response).to redirect_to(wizard.success_path)
1815

19-
follow_redirect!
20-
expect(response.body).to include(wizard.success_message)
16+
# The controller preserves the notice in the flash; assert it directly
17+
expect(flash[:notice]).to eq(wizard.success_message)
2118
end
2219
end

0 commit comments

Comments
 (0)