mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
First cut of a simplified "intro" UI layout (#265)
* First cut of a simplified "intro" UI layout * Linter * Add guest role and intro-only access * Fix guest role UI defaults (#940) Use enum predicate to avoid missing role helper. * Remove legacy user role mapping (#941) Drop the unused user role references in role normalization and SSO role mapping forms to avoid implying a role that never existed. Refs: #0 * Remove role normalization (#942) Remove role normalization Roles are now stored directly without legacy mappings. * Revert role mapping logic * Remove `normalize_role_settings` * Remove unnecessary migration * Make `member` the default * Broken `.erb` --------- Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
@@ -67,4 +67,24 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test "creating account from guest invitation assigns guest role and intro layout" do
|
||||
invitation = invitations(:one)
|
||||
invitation.update!(role: "guest", email: "guest-signup@example.com")
|
||||
|
||||
assert_difference "User.count", +1 do
|
||||
post registration_url, params: { user: {
|
||||
email: invitation.email,
|
||||
password: "Password1!",
|
||||
invitation: invitation.token
|
||||
} }
|
||||
end
|
||||
|
||||
created_user = User.find_by(email: invitation.email)
|
||||
assert_equal "guest", created_user.role
|
||||
assert created_user.ui_layout_intro?
|
||||
assert_not created_user.show_sidebar?
|
||||
assert_not created_user.show_ai_sidebar?
|
||||
assert created_user.ai_enabled?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user