mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 21:29:38 +02:00
Chromium E2E test fixes (#2108)
* Change test password to avoid chromium conflicts * Update integration tests * Centralize all test password references * Remove unrelated schema changes
This commit is contained in:
parent
48c8499b70
commit
1e01840fee
6 changed files with 17 additions and 13 deletions
2
db/schema.rb
generated
2
db/schema.rb
generated
|
@ -101,7 +101,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_04_11_140604) do
|
||||||
t.decimal "balance", precision: 19, scale: 4
|
t.decimal "balance", precision: 19, scale: 4
|
||||||
t.string "currency"
|
t.string "currency"
|
||||||
t.boolean "is_active", default: true, null: false
|
t.boolean "is_active", default: true, null: false
|
||||||
t.virtual "classification", type: :string, as: "\nCASE\n WHEN ((accountable_type)::text = ANY (ARRAY[('Loan'::character varying)::text, ('CreditCard'::character varying)::text, ('OtherLiability'::character varying)::text])) THEN 'liability'::text\n ELSE 'asset'::text\nEND", stored: true
|
t.virtual "classification", type: :string, as: "\nCASE\n WHEN ((accountable_type)::text = ANY ((ARRAY['Loan'::character varying, 'CreditCard'::character varying, 'OtherLiability'::character varying])::text[])) THEN 'liability'::text\n ELSE 'asset'::text\nEND", stored: true
|
||||||
t.uuid "import_id"
|
t.uuid "import_id"
|
||||||
t.uuid "plaid_account_id"
|
t.uuid "plaid_account_id"
|
||||||
t.boolean "scheduled_for_deletion", default: false
|
t.boolean "scheduled_for_deletion", default: false
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||||
visit new_session_path
|
visit new_session_path
|
||||||
within "form" do
|
within "form" do
|
||||||
fill_in "Email", with: user.email
|
fill_in "Email", with: user.email
|
||||||
fill_in "Password", with: "password"
|
fill_in "Password", with: user_password_test
|
||||||
click_on "Log in"
|
click_on "Log in"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ class MfaControllerTest < ActionDispatch::IntegrationTest
|
||||||
@user.enable_mfa!
|
@user.enable_mfa!
|
||||||
sign_out
|
sign_out
|
||||||
|
|
||||||
post sessions_path, params: { email: @user.email, password: "password" }
|
post sessions_path, params: { email: @user.email, password: user_password_test }
|
||||||
assert_redirected_to verify_mfa_path
|
assert_redirected_to verify_mfa_path
|
||||||
|
|
||||||
get verify_mfa_path
|
get verify_mfa_path
|
||||||
|
@ -67,7 +67,7 @@ class MfaControllerTest < ActionDispatch::IntegrationTest
|
||||||
@user.enable_mfa!
|
@user.enable_mfa!
|
||||||
sign_out
|
sign_out
|
||||||
|
|
||||||
post sessions_path, params: { email: @user.email, password: "password" }
|
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: "Maybe")
|
||||||
|
|
||||||
post verify_mfa_path, params: { code: totp.now }
|
post verify_mfa_path, params: { code: totp.now }
|
||||||
|
@ -81,7 +81,7 @@ class MfaControllerTest < ActionDispatch::IntegrationTest
|
||||||
@user.enable_mfa!
|
@user.enable_mfa!
|
||||||
sign_out
|
sign_out
|
||||||
|
|
||||||
post sessions_path, params: { email: @user.email, password: "password" }
|
post sessions_path, params: { email: @user.email, password: user_password_test }
|
||||||
backup_code = @user.otp_backup_codes.first
|
backup_code = @user.otp_backup_codes.first
|
||||||
|
|
||||||
post verify_mfa_path, params: { code: backup_code }
|
post verify_mfa_path, params: { code: backup_code }
|
||||||
|
@ -96,7 +96,7 @@ class MfaControllerTest < ActionDispatch::IntegrationTest
|
||||||
@user.enable_mfa!
|
@user.enable_mfa!
|
||||||
sign_out
|
sign_out
|
||||||
|
|
||||||
post sessions_path, params: { email: @user.email, password: "password" }
|
post sessions_path, params: { email: @user.email, password: user_password_test }
|
||||||
post verify_mfa_path, params: { code: "invalid" }
|
post verify_mfa_path, params: { code: "invalid" }
|
||||||
|
|
||||||
assert_response :unprocessable_entity
|
assert_response :unprocessable_entity
|
||||||
|
|
|
@ -42,7 +42,7 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
|
||||||
@user.enable_mfa!
|
@user.enable_mfa!
|
||||||
@user.sessions.destroy_all # Clean up any existing sessions
|
@user.sessions.destroy_all # Clean up any existing sessions
|
||||||
|
|
||||||
post sessions_path, params: { email: @user.email, password: "password" }
|
post sessions_path, params: { email: @user.email, password: user_password_test }
|
||||||
|
|
||||||
assert_redirected_to verify_mfa_path
|
assert_redirected_to verify_mfa_path
|
||||||
assert_equal @user.id, session[:mfa_user_id]
|
assert_equal @user.id, session[:mfa_user_id]
|
||||||
|
|
10
test/fixtures/users.yml
vendored
10
test/fixtures/users.yml
vendored
|
@ -3,7 +3,7 @@ empty:
|
||||||
first_name: User
|
first_name: User
|
||||||
last_name: One
|
last_name: One
|
||||||
email: user1@email.com
|
email: user1@email.com
|
||||||
password_digest: $2a$12$7p8hMsoc0zSaC8eY9oewzelHbmCPdpPi.mGiyG4vdZwrXmGpRPoNK
|
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||||
onboarded_at: <%= 3.days.ago %>
|
onboarded_at: <%= 3.days.ago %>
|
||||||
ai_enabled: true
|
ai_enabled: true
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ maybe_support_staff:
|
||||||
first_name: Support
|
first_name: Support
|
||||||
last_name: Admin
|
last_name: Admin
|
||||||
email: support@maybefinance.com
|
email: support@maybefinance.com
|
||||||
password_digest: $2a$12$7p8hMsoc0zSaC8eY9oewzelHbmCPdpPi.mGiyG4vdZwrXmGpRPoNK
|
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||||
role: super_admin
|
role: super_admin
|
||||||
onboarded_at: <%= 3.days.ago %>
|
onboarded_at: <%= 3.days.ago %>
|
||||||
ai_enabled: true
|
ai_enabled: true
|
||||||
|
@ -22,7 +22,7 @@ family_admin:
|
||||||
first_name: Bob
|
first_name: Bob
|
||||||
last_name: Dylan
|
last_name: Dylan
|
||||||
email: bob@bobdylan.com
|
email: bob@bobdylan.com
|
||||||
password_digest: $2a$12$7p8hMsoc0zSaC8eY9oewzelHbmCPdpPi.mGiyG4vdZwrXmGpRPoNK
|
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||||
role: admin
|
role: admin
|
||||||
onboarded_at: <%= 3.days.ago %>
|
onboarded_at: <%= 3.days.ago %>
|
||||||
ai_enabled: true
|
ai_enabled: true
|
||||||
|
@ -32,7 +32,7 @@ family_member:
|
||||||
first_name: Jakob
|
first_name: Jakob
|
||||||
last_name: Dylan
|
last_name: Dylan
|
||||||
email: jakobdylan@yahoo.com
|
email: jakobdylan@yahoo.com
|
||||||
password_digest: $2a$12$7p8hMsoc0zSaC8eY9oewzelHbmCPdpPi.mGiyG4vdZwrXmGpRPoNK
|
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||||
onboarded_at: <%= 3.days.ago %>
|
onboarded_at: <%= 3.days.ago %>
|
||||||
ai_enabled: true
|
ai_enabled: true
|
||||||
|
|
||||||
|
@ -42,6 +42,6 @@ new_email:
|
||||||
last_name: User
|
last_name: User
|
||||||
email: user@example.com
|
email: user@example.com
|
||||||
unconfirmed_email: new@example.com
|
unconfirmed_email: new@example.com
|
||||||
password_digest: $2a$12$7p8hMsoc0zSaC8eY9oewzelHbmCPdpPi.mGiyG4vdZwrXmGpRPoNK
|
password_digest: $2a$12$XoNBo/cMCyzpYtvhrPAhsubG21mELX48RAcjSVCRctW8dG8wrDIla
|
||||||
onboarded_at: <%= Time.current %>
|
onboarded_at: <%= Time.current %>
|
||||||
ai_enabled: true
|
ai_enabled: true
|
|
@ -49,7 +49,7 @@ module ActiveSupport
|
||||||
|
|
||||||
# Add more helper methods to be used by all tests here...
|
# Add more helper methods to be used by all tests here...
|
||||||
def sign_in(user)
|
def sign_in(user)
|
||||||
post sessions_path, params: { email: user.email, password: "password" }
|
post sessions_path, params: { email: user.email, password: user_password_test }
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_env_overrides(overrides = {}, &block)
|
def with_env_overrides(overrides = {}, &block)
|
||||||
|
@ -60,6 +60,10 @@ module ActiveSupport
|
||||||
Rails.configuration.stubs(:app_mode).returns("self_hosted".inquiry)
|
Rails.configuration.stubs(:app_mode).returns("self_hosted".inquiry)
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_password_test
|
||||||
|
"maybetestpassword817983172"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue