|
|
@ -2,21 +2,21 @@ |
|
|
|
|
|
|
|
require 'rails_helper' |
|
|
|
|
|
|
|
feature 'Log in' do |
|
|
|
describe 'Log in' do |
|
|
|
include ProfileStories |
|
|
|
|
|
|
|
given(:email) { "test@example.com" } |
|
|
|
given(:password) { "password" } |
|
|
|
given(:confirmed_at) { Time.zone.now } |
|
|
|
subject { page } |
|
|
|
|
|
|
|
let(:email) { "test@example.com" } |
|
|
|
let(:password) { "password" } |
|
|
|
let(:confirmed_at) { Time.zone.now } |
|
|
|
|
|
|
|
background do |
|
|
|
before do |
|
|
|
as_a_registered_user |
|
|
|
visit new_user_session_path |
|
|
|
end |
|
|
|
|
|
|
|
subject { page } |
|
|
|
|
|
|
|
scenario 'A valid email and password user is able to log in' do |
|
|
|
it 'A valid email and password user is able to log in' do |
|
|
|
fill_in 'user_email', with: email |
|
|
|
fill_in 'user_password', with: password |
|
|
|
click_on I18n.t('auth.login') |
|
|
@ -24,7 +24,7 @@ feature 'Log in' do |
|
|
|
is_expected.to have_css('div.app-holder') |
|
|
|
end |
|
|
|
|
|
|
|
scenario 'A invalid email and password user is not able to log in' do |
|
|
|
it 'A invalid email and password user is not able to log in' do |
|
|
|
fill_in 'user_email', with: 'invalid_email' |
|
|
|
fill_in 'user_password', with: 'invalid_password' |
|
|
|
click_on I18n.t('auth.login') |
|
|
@ -33,9 +33,9 @@ feature 'Log in' do |
|
|
|
end |
|
|
|
|
|
|
|
context do |
|
|
|
given(:confirmed_at) { nil } |
|
|
|
let(:confirmed_at) { nil } |
|
|
|
|
|
|
|
scenario 'A unconfirmed user is able to log in' do |
|
|
|
it 'A unconfirmed user is able to log in' do |
|
|
|
fill_in 'user_email', with: email |
|
|
|
fill_in 'user_password', with: password |
|
|
|
click_on I18n.t('auth.login') |
|
|
|