mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Add family moniker selection and dynamic UI labels (#981)
* Add family moniker selection and dynamic UI labels Introduce a Family moniker persisted in the database with allowed values Family/Group, add required onboarding selection for it, and thread moniker-aware copy through key user-facing views and locales. Also add helper methods and tests for onboarding form presence and family moniker behavior. * Small copy edits/change moniker question order * Conditional Group/Family onboarding flow fixes * Fix label * Grouping of fields * Profile Info page Group/Family changes * Only admins can change Group/Family moniker * Repetitive defaults * Moniker in Account model * Moniker in User model * Auth fix * Sure product is also a moniker --------- Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
@@ -17,6 +17,16 @@ class OnboardingsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_select "h1", text: /set up your account/i
|
||||
end
|
||||
|
||||
|
||||
test "onboarding setup includes required moniker selection" do
|
||||
get onboarding_url
|
||||
assert_response :success
|
||||
|
||||
assert_select "input[name='user[family_attributes][moniker]'][value='Family'][required]"
|
||||
assert_select "input[name='user[family_attributes][moniker]'][value='Group'][required]"
|
||||
assert_select "p", text: /Will be using Sure with/i
|
||||
end
|
||||
|
||||
test "should get preferences" do
|
||||
get preferences_onboarding_url
|
||||
assert_response :success
|
||||
|
||||
@@ -36,6 +36,19 @@ class FamilyTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test "moniker helpers return expected singular and plural labels" do
|
||||
family = families(:dylan_family)
|
||||
|
||||
family.update!(moniker: "Family")
|
||||
assert_equal "Family", family.moniker_label
|
||||
assert_equal "Families", family.moniker_label_plural
|
||||
|
||||
family.update!(moniker: "Group")
|
||||
assert_equal "Group", family.moniker_label
|
||||
assert_equal "Groups", family.moniker_label_plural
|
||||
end
|
||||
|
||||
test "available_merchants includes family merchants without transactions" do
|
||||
family = families(:dylan_family)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user