Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshinotsuyoshi committed Oct 14, 2024
1 parent 2465c02 commit 1c219ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/spec/system/scenarios/login_flow_spec.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
require 'rails_helper'

RSpec.describe "login flow", type: :system do
include ActiveJob::TestHelper

before do
driven_by(:headless_chrome)
end
let!(:user) { create(:user) }

it 'me -> login -> me' do
it 'me -> login -> me -> logout -> me -> login' do
visit '/me'

fill_in "email", with: user.email_address
fill_in "password", with: user.password
click_button "Login"

expect(page).to have_content("hello, It's me!")
sleep 2
expect(page).to have_content(user.email_address)
accept_alert do
click_button "Logout"
end
expect(page).to have_content("Login")
expect(current_path).to eq("/login")
end
end

0 comments on commit 1c219ae

Please sign in to comment.