Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-coggin committed Jul 12, 2023
1 parent 296995b commit 861919f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
4 changes: 1 addition & 3 deletions app/controllers/registration/training_emails_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ def update
@user_form = Users::TrainingEmailsForm.new(user_params.merge(user: current_user))

if @user_form.save
if ENV['EARLY_YEARS_EMAILS']
redirect_to edit_registration_early_years_emails_path
elsif current_user.registration_complete?
if current_user.registration_complete?
redirect_to my_modules_path, notice: t('.complete_update')
else
complete_registration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@
describe 'POST #update' do
it 'succeeds' do
post :update, params: { user: { training_emails: 'true' } }
if ENV['EARLY_YEARS_EMAILS']
expect(response).to redirect_to edit_registration_early_years_emails_path
else
expect(response).to redirect_to my_modules_path
end
expect(response).to redirect_to my_modules_path
expect(confirmed_user.reload.training_emails).to eq true
end
end
Expand Down
6 changes: 1 addition & 5 deletions spec/requests/registration/training_emails_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@

it 'redirects to my training email preference' do
update_user
if ENV['EARLY_YEARS_EMAILS']
expect(response).to redirect_to(edit_registration_early_years_emails_path)
else
expect(response).to redirect_to(my_modules_path)
end
expect(response).to redirect_to(my_modules_path)
end
end
end
Expand Down
15 changes: 0 additions & 15 deletions spec/system/confirmed_user/completing_registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,6 @@

end

if ENV['EARLY_YEARS_EMAILS']

expect(page).to have_text('Do you want to get early years email updates from the Department for Education?')

click_button 'Continue'

expect(page).to have_text('There is a problem')
.and have_text('Choose an option.')

choose 'Send me early years email updates'

click_button 'Continue'

end

expect(page).to have_text('Thank you for creating an Early years child development training account. You can now start the first module.')
end
end

0 comments on commit 861919f

Please sign in to comment.