Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename consent school step #1833

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def update
model.assign_attributes(update_params)
end

if current_step == :school && @consent_form.is_this_their_school == "no"
if current_step == :confirm_school &&
@consent_form.is_this_their_school == "no"
redirect_to session_parent_interface_consent_form_cannot_consent_school_path(
@session,
@consent_form
Expand Down Expand Up @@ -72,7 +73,7 @@ def update_params
date_of_birth(2i)
date_of_birth(1i)
],
school: %i[is_this_their_school],
confirm_school: %i[is_this_their_school],
parent: %i[
parent_email
parent_name
Expand Down
4 changes: 2 additions & 2 deletions app/models/consent_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class ConsentForm < ApplicationRecord
}
end

on_wizard_step :school, exact: true do
on_wizard_step :confirm_school, exact: true do
validates :is_this_their_school, inclusion: { in: %w[yes no] }
end

Expand Down Expand Up @@ -238,7 +238,7 @@ def wizard_steps
[
:name,
:date_of_birth,
:school,
:confirm_school,
:parent,
(:contact_method if parent_phone.present?),
:consent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% content_for :before_main do %>
<%= render AppBacklinkComponent.new(
href: session_parent_interface_consent_form_edit_path(@session, @consent_form, :school),
href: session_parent_interface_consent_form_edit_path(@session, @consent_form, "confirm-school"),
name: "edit school page",
) %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ en:
batch: batch
cohort: cohort
confirm: confirm
confirm_school: confirm-school
consent: consent
contact_method: contact-method
date_of_birth: date-of-birth
Expand Down
4 changes: 2 additions & 2 deletions spec/models/consent_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
# .on(:update) }
end

context "when wizard_step is :school" do
let(:wizard_step) { :school }
context "when wizard_step is :confirm_school" do
let(:wizard_step) { :confirm_school }

context "runs validations from previous steps" do
it { should validate_presence_of(:first_name).on(:update) }
Expand Down