File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
app/controllers/concerns/better_together
spec/requests/better_together Expand file tree Collapse file tree 2 files changed +24
-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' , type : :request do
6+ let! ( :platform ) { create ( :better_together_platform , :host , privacy : 'private' ) }
7+ let! ( :wizard ) { BetterTogether ::Wizard . find_by! ( identifier : 'host_setup' ) }
8+ let! ( :user ) { create ( :better_together_user , :confirmed , :platform_manager ) }
9+
10+ before do
11+ wizard . mark_completed
12+ login_as ( user , scope : :user )
13+ end
14+
15+ it 'redirects to the success path with notice preserved' do
16+ get better_together . setup_wizard_path ( locale : I18n . locale )
17+ expect ( response ) . to redirect_to ( wizard . success_path )
18+
19+ follow_redirect!
20+ expect ( response . body ) . to include ( wizard . success_message )
21+ end
22+ end
You can’t perform that action at this time.
0 commit comments