-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2465c02
commit 1c219ae
Showing
1 changed file
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |