mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
More rebranding changes (#159)
* Replace Maybe for Sure in select code areas * Make sure passwords are consistent * Remove (admin|member) from demo data first name * Database and schema names finally to `sure` * Fix broken test * Another (benchmarking) database name to `sure_*` * More rebranding to Sure * Missed this Maybe mention in the same page * Random nitpicks and more Maybes * Demo data accounts and more Maybes * Test data account updates * Impersonation test accounts * Consistency with `compose.example.yml`
This commit is contained in:
@@ -5,7 +5,7 @@ class DialogComponentPreview < ViewComponent::Preview
|
||||
dialog.with_header(title: "Sample modal title")
|
||||
|
||||
dialog.with_body do
|
||||
"Welcome to Maybe! This is some test modal content."
|
||||
"Welcome to Sure! This is some test modal content."
|
||||
end
|
||||
|
||||
dialog.with_action(cancel_action: true, text: "Cancel", variant: "outline")
|
||||
|
||||
@@ -2,7 +2,7 @@ require "test_helper"
|
||||
|
||||
class ImpersonationSessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
test "impersonation session logs all activity for auditing" do
|
||||
sign_in impersonator = users(:maybe_support_staff)
|
||||
sign_in impersonator = users(:sure_support_staff)
|
||||
impersonated = users(:family_member)
|
||||
|
||||
impersonator_session = impersonation_sessions(:in_progress)
|
||||
@@ -16,7 +16,7 @@ class ImpersonationSessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "super admin can request an impersonation session" do
|
||||
sign_in users(:maybe_support_staff)
|
||||
sign_in users(:sure_support_staff)
|
||||
|
||||
post impersonation_sessions_path, params: { impersonation_session: { impersonated_id: users(:family_member).id } }
|
||||
|
||||
@@ -25,7 +25,7 @@ class ImpersonationSessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "super admin can join and leave an in progress impersonation session" do
|
||||
sign_in super_admin = users(:maybe_support_staff)
|
||||
sign_in super_admin = users(:sure_support_staff)
|
||||
|
||||
impersonator_session = impersonation_sessions(:in_progress)
|
||||
|
||||
@@ -52,7 +52,7 @@ class ImpersonationSessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "super admin can complete an impersonation session" do
|
||||
sign_in super_admin = users(:maybe_support_staff)
|
||||
sign_in super_admin = users(:sure_support_staff)
|
||||
|
||||
impersonator_session = impersonation_sessions(:in_progress)
|
||||
|
||||
@@ -77,7 +77,7 @@ class ImpersonationSessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "super admin cannot accept an impersonation session" do
|
||||
sign_in super_admin = users(:maybe_support_staff)
|
||||
sign_in super_admin = users(:sure_support_staff)
|
||||
|
||||
impersonator_session = impersonation_sessions(:in_progress)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class MfaControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
test "enables MFA with valid code" do
|
||||
@user.setup_mfa!
|
||||
totp = ROTP::TOTP.new(@user.otp_secret, issuer: "Maybe")
|
||||
totp = ROTP::TOTP.new(@user.otp_secret, issuer: "Sure Finances")
|
||||
|
||||
post mfa_path, params: { code: totp.now }
|
||||
|
||||
@@ -70,7 +70,7 @@ class MfaControllerTest < ActionDispatch::IntegrationTest
|
||||
sign_out
|
||||
|
||||
post sessions_path, params: { email: @user.email, password: user_password_test }
|
||||
totp = ROTP::TOTP.new(@user.otp_secret, issuer: "Maybe")
|
||||
totp = ROTP::TOTP.new(@user.otp_secret, issuer: "Sure Finances")
|
||||
|
||||
post verify_mfa_path, params: { code: totp.now }
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class OnboardingsControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should get goals" do
|
||||
get goals_onboarding_url
|
||||
assert_response :success
|
||||
assert_select "h1", text: /What brings you to Maybe/i
|
||||
assert_select "h1", text: /What brings you to Sure/i
|
||||
end
|
||||
|
||||
test "should get trial" do
|
||||
|
||||
@@ -26,7 +26,7 @@ class SubscriptionsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
assert_redirected_to root_path
|
||||
assert_equal "Welcome to Maybe!", flash[:notice]
|
||||
assert_equal "Welcome to Sure!", flash[:notice]
|
||||
assert_equal "trialing", @family.subscription.status
|
||||
assert_in_delta Subscription::TRIAL_DAYS.days.from_now, @family.subscription.trial_ends_at, 1.minute
|
||||
end
|
||||
@@ -71,6 +71,6 @@ class SubscriptionsControllerTest < ActionDispatch::IntegrationTest
|
||||
get success_subscription_url(session_id: "test-session-id")
|
||||
|
||||
assert @family.subscription.active?
|
||||
assert_equal "Welcome to Maybe! Your subscription has been created.", flash[:notice]
|
||||
assert_equal "Welcome to Sure! Your subscription has been created.", flash[:notice]
|
||||
end
|
||||
end
|
||||
|
||||
2
test/fixtures/impersonation_sessions.yml
vendored
2
test/fixtures/impersonation_sessions.yml
vendored
@@ -1,4 +1,4 @@
|
||||
in_progress:
|
||||
impersonator: maybe_support_staff
|
||||
impersonator: sure_support_staff
|
||||
impersonated: family_member
|
||||
status: in_progress
|
||||
|
||||
6
test/fixtures/users.yml
vendored
6
test/fixtures/users.yml
vendored
@@ -2,17 +2,17 @@ empty:
|
||||
family: empty
|
||||
first_name: User
|
||||
last_name: One
|
||||
email: user1@email.com
|
||||
email: user1@example.com
|
||||
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||
onboarded_at: <%= 3.days.ago %>
|
||||
role: admin
|
||||
ai_enabled: true
|
||||
|
||||
maybe_support_staff:
|
||||
sure_support_staff:
|
||||
family: empty
|
||||
first_name: Support
|
||||
last_name: Admin
|
||||
email: support@maybefinance.com
|
||||
email: support@sure.am
|
||||
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||
role: super_admin
|
||||
onboarded_at: <%= 3.days.ago %>
|
||||
|
||||
@@ -8,7 +8,7 @@ class OauthMobileTest < ActionDispatch::IntegrationTest
|
||||
sign_in(@user)
|
||||
|
||||
@oauth_app = Doorkeeper::Application.create!(
|
||||
name: "Maybe Mobile App",
|
||||
name: "Sure Mobile App",
|
||||
redirect_uri: "sureapp://oauth/callback",
|
||||
scopes: "read"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ class EmailConfirmationMailerTest < ActionMailer::TestCase
|
||||
mail = EmailConfirmationMailer.with(user: user).confirmation_email
|
||||
assert_equal I18n.t("email_confirmation_mailer.confirmation_email.subject"), mail.subject
|
||||
assert_equal [ user.unconfirmed_email ], mail.to
|
||||
assert_equal [ "hello@maybefinance.com" ], mail.from
|
||||
assert_equal [ "hello@example.com" ], mail.from
|
||||
assert_match "confirm", mail.body.encoded
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ class FamilyExportTest < ActiveSupport::TestCase
|
||||
test "filename is generated correctly" do
|
||||
travel_to Time.zone.local(2024, 1, 15, 14, 30, 0) do
|
||||
export = @family.family_exports.create!
|
||||
expected_filename = "maybe_export_20240115_143000.zip"
|
||||
expected_filename = "sure_export_20240115_143000.zip"
|
||||
assert_equal expected_filename, export.filename
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,13 +9,13 @@ class ImpersonationSessionTest < ActiveSupport::TestCase
|
||||
assert_raises(ActiveRecord::RecordInvalid) do
|
||||
ImpersonationSession.create!(
|
||||
impersonator: regular_user,
|
||||
impersonated: users(:maybe_support_staff)
|
||||
impersonated: users(:sure_support_staff)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
test "super admin cannot be impersonated" do
|
||||
super_admin = users(:maybe_support_staff)
|
||||
super_admin = users(:sure_support_staff)
|
||||
|
||||
assert super_admin.super_admin?
|
||||
|
||||
@@ -28,7 +28,7 @@ class ImpersonationSessionTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "impersonation session must have different impersonator and impersonated" do
|
||||
super_admin = users(:maybe_support_staff)
|
||||
super_admin = users(:sure_support_staff)
|
||||
|
||||
assert_raises(ActiveRecord::RecordInvalid) do
|
||||
ImpersonationSession.create!(
|
||||
|
||||
@@ -106,7 +106,7 @@ class UserTest < ActiveSupport::TestCase
|
||||
user = users(:family_member)
|
||||
user.setup_mfa!
|
||||
|
||||
totp = ROTP::TOTP.new(user.otp_secret, issuer: "Maybe")
|
||||
totp = ROTP::TOTP.new(user.otp_secret, issuer: "Sure Finances")
|
||||
valid_code = totp.now
|
||||
|
||||
assert user.verify_otp?(valid_code)
|
||||
@@ -136,7 +136,7 @@ class UserTest < ActiveSupport::TestCase
|
||||
|
||||
assert_match %r{otpauth://totp/}, user.provisioning_uri
|
||||
assert_match %r{secret=#{user.otp_secret}}, user.provisioning_uri
|
||||
assert_match %r{issuer=Maybe}, user.provisioning_uri
|
||||
assert_match %r{issuer=Sure}, user.provisioning_uri
|
||||
end
|
||||
|
||||
test "ai_available? returns true when openai access token set in settings" do
|
||||
|
||||
@@ -12,7 +12,7 @@ class ChatsTest < ApplicationSystemTestCase
|
||||
visit root_path
|
||||
|
||||
within "#chat-container" do
|
||||
assert_selector "h3", text: "Enable Maybe AI"
|
||||
assert_selector "h3", text: "Enable AI Chats"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class OnboardingsTest < ApplicationSystemTestCase
|
||||
|
||||
# Should redirect to goals page
|
||||
assert_current_path goals_onboarding_path
|
||||
assert_text "What brings you to Maybe?"
|
||||
assert_text "What brings you to Sure?"
|
||||
end
|
||||
|
||||
test "preferences page renders chart without errors" do
|
||||
@@ -137,7 +137,7 @@ class OnboardingsTest < ApplicationSystemTestCase
|
||||
|
||||
visit goals_onboarding_path
|
||||
|
||||
assert_text "What brings you to Maybe?"
|
||||
assert_text "What brings you to Sure?"
|
||||
assert_button "Next"
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ http_interactions:
|
||||
uri: https://sandbox.plaid.com/link/token/create
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"client_name":"Maybe Finance","language":"en","country_codes":["US","CA"],"user":{"client_user_id":"test-user-id"},"products":["transactions"],"additional_consented_products":["investments","liabilities"],"webhook":"https://example.com/webhooks","redirect_uri":"http://localhost:3000/accounts","transactions":{"days_requested":730}}'
|
||||
string: '{"client_name":"Sure Finances","language":"en","country_codes":["US","CA"],"user":{"client_user_id":"test-user-id"},"products":["transactions"],"additional_consented_products":["investments","liabilities"],"webhook":"https://example.com/webhooks","redirect_uri":"http://localhost:3000/accounts","transactions":{"days_requested":730}}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
|
||||
@@ -114,13 +114,13 @@ http_interactions:
|
||||
"postal_code": "12345",
|
||||
"state": null
|
||||
},
|
||||
"email": "user@sure.local",
|
||||
"email": "user@example.com",
|
||||
"name": "Test Checkout User",
|
||||
"phone": null,
|
||||
"tax_exempt": "none",
|
||||
"tax_ids": []
|
||||
},
|
||||
"customer_email": "user@sure.local",
|
||||
"customer_email": "user@example.com",
|
||||
"discounts": [],
|
||||
"expires_at": 1746368350,
|
||||
"invoice": "in_1RKguoQT2jbOS8G0PuBVklxw",
|
||||
|
||||
Reference in New Issue
Block a user