Skip to content

Commit ef311f0

Browse files
333 add consent to uxr contact checkbox to the school onboarding flow (#465)
## Status - Closes [#333](RaspberryPiFoundation/digital-editor-issues#333) - Related to _add issue numbers or delete_ ## Points for consideration: - Security - Performance ## What's changed? Created a new migration for school table: - added new colunm => **creator_agree_to_ux_contact** ## Steps to perform after deploying to production _If the production environment requires any extra work after this PR has been deployed detail it here. This could be running a Rake task, a migration, or upgrading a Gem. That kind of thing._
1 parent b9f7ee2 commit ef311f0

File tree

7 files changed

+19
-4
lines changed

7 files changed

+19
-4
lines changed

Diff for: app/controllers/api/schools_controller.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ def school_params
6363
:creator_role,
6464
:creator_department,
6565
:creator_agree_authority,
66-
:creator_agree_terms_and_conditions
66+
:creator_agree_terms_and_conditions,
67+
:creator_agree_to_ux_contact
6768
)
6869
end
6970
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddCreatorAgreeToUxContact < ActiveRecord::Migration[7.1]
2+
def change
3+
add_column :schools, :creator_agree_to_ux_contact, :boolean, default: false
4+
end
5+
end

Diff for: db/schema.rb

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/tasks/seeds_helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def create_school(creator_id, school_id = nil)
2323
school.creator_id = creator_id
2424
school.creator_agree_authority = true
2525
school.creator_agree_terms_and_conditions = true
26+
school.creator_agree_to_ux_contact = true
2627
end
2728
end
2829

Diff for: spec/concepts/school/create_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
municipality: 'Greater London',
1212
country_code: 'GB',
1313
creator_agree_authority: true,
14-
creator_agree_terms_and_conditions: true
14+
creator_agree_terms_and_conditions: true,
15+
creator_agree_to_ux_contact: true
1516
}
1617
end
1718

Diff for: spec/features/school/creating_a_school_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
municipality: 'Greater London',
2121
country_code: 'GB',
2222
creator_agree_authority: true,
23-
creator_agree_terms_and_conditions: true
23+
creator_agree_terms_and_conditions: true,
24+
creator_agree_to_ux_contact: true
2425
}
2526
}
2627
end

Diff for: spec/models/school_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@
183183
expect(school).to be_invalid
184184
end
185185

186+
it 'does not require creator_agree_to_ux_contact to be true' do
187+
school.creator_agree_to_ux_contact = false
188+
expect(school).to be_valid
189+
end
190+
186191
it 'cannot have #rejected_at set when #verified_at is present' do
187192
school.verify!
188193
school.reject

0 commit comments

Comments
 (0)