File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
app/controllers/concerns/better_together
spec/requests/better_together Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,8 @@ def determine_wizard_outcome # rubocop:todo Metrics/AbcSize
1515 raise StandardError , "Wizard #{ wizard_identifier } was not found. Have you run the seeds?" unless wizard
1616
1717 if wizard . completed?
18- flash [ :notice ] = wizard . success_message
19- # TODO: This needs to be adjusted for private platforms. Flash message is not retained after wizard completion
20- redirect_to wizard . success_path
18+ flash . keep ( :notice )
19+ redirect_to wizard . success_path , notice : wizard . success_message
2120 else
2221 next_step_path , flash_key , message = wizard_next_step_info
2322 flash [ flash_key ] = message if message
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'rails_helper'
4+
5+ RSpec . describe 'Setup Wizard completion' do
6+ let! ( :wizard ) { BetterTogether ::Wizard . find_by! ( identifier : 'host_setup' ) }
7+
8+ before do
9+ wizard . mark_completed
10+ end
11+
12+ it 'redirects to the success path with notice preserved' do # rubocop:disable RSpec/MultipleExpectations
13+ get better_together . setup_wizard_path ( locale : I18n . locale )
14+ expect ( response ) . to redirect_to ( wizard . success_path )
15+
16+ # The controller preserves the notice in the flash; assert it directly
17+ expect ( flash [ :notice ] ) . to eq ( wizard . success_message )
18+ end
19+ end
You can’t perform that action at this time.
0 commit comments