Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-coggin committed Jul 12, 2023
1 parent 26c6474 commit 9d3bca2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
8 changes: 3 additions & 5 deletions app/controllers/registration/training_emails_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ def update
if @user_form.save
if ENV['EARLY_YEARS_EMAILS']
redirect_to edit_registration_early_years_emails_path
elsif current_user.registration_complete?
redirect_to my_modules_path, notice: t('.complete_update')
else
if current_user.registration_complete?
redirect_to my_modules_path, notice: t('.complete_update')
else
complete_registration
end
complete_registration
end
else
render :edit, status: :unprocessable_entity
Expand Down
32 changes: 16 additions & 16 deletions app/forms/users/early_years_emails_form.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module Users
class EarlyYearsEmailsForm < BaseForm
attr_accessor :early_years_emails

validates :early_years_emails, presence: true

def name
'early_years_emails'
end

def save
if valid?
user.update!(
early_years_emails: early_years_emails,
)
end
class EarlyYearsEmailsForm < BaseForm
attr_accessor :early_years_emails

validates :early_years_emails, presence: true

def name
'early_years_emails'
end

def save
if valid?
user.update!(
early_years_emails: early_years_emails,
)
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/system/confirmed_user/completing_registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
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.')
Expand Down

0 comments on commit 9d3bca2

Please sign in to comment.