-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #536 from rootstrap/feature/capybara
Add capybara
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'Admin SignIn' do | ||
feature 'Signing in' do | ||
let(:admin_user) { create(:admin_user) } | ||
|
||
scenario 'Admin signs in successfully' do | ||
visit admin_root_path | ||
fill_in 'Email', with: admin_user.email | ||
fill_in 'Password', with: admin_user.password | ||
click_button 'Login' | ||
|
||
expect(page).to have_content 'Signed in successfully.' | ||
end | ||
|
||
scenario 'Admin fails to sign in with invalid credentials' do | ||
visit admin_root_path | ||
fill_in 'Email', with: '[email protected]' | ||
fill_in 'Password', with: 'wrongpassword' | ||
click_button 'Login' | ||
|
||
expect(page).to have_content 'Invalid Email or password.' | ||
end | ||
end | ||
end |
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