1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-25 16:19:40 +02:00
Maybe/test/application_system_test_case.rb
Pablo Porto 00a42be5c0
fix(authentication): Fix issues when users try to logout (#603)
Run set last login information action only when the user exist. Thus preventing running it after the logout method, which was causing an error
2024-04-08 07:26:46 -04:00

20 lines
521 B
Ruby

require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
private
def sign_in(user)
visit new_session_path
within "form" do
fill_in "Email", with: user.email
fill_in "Password", with: "password"
click_button "Log in"
end
assert_text "Dashboard", wait: 5
find('[data-controller="menu"]').click
click_button "Logout"
assert_text "Sign in to your account"
end
end