Sha256: befbd535afec8de84487e7db309ba812b0afab7353ff6fffa076c5bb963fe48f
Contents?: true
Size: 1.69 KB
Versions: 1
Compression:
Stored size: 1.69 KB
Contents
# Feature: Sign in # As a user # I want to sign in # So I can visit protected areas of the site feature 'Sign in', :devise do # Scenario: User cannot sign in if not registered # Given I do not exist as a user # When I sign in with valid credentials # Then I see an invalid credentials message scenario 'user cannot sign in if not registered' do signin('test@example.com', 'please123') expect(page).to have_content I18n.t 'devise.failure.not_found_in_database' end # Scenario: User can sign in with valid credentials # Given I exist as a user # And I am not signed in # When I sign in with valid credentials # Then I see a success message scenario 'user can sign in with valid credentials' do user = FactoryGirl.create(:user) signin(user.email, user.password) expect(page).to have_content I18n.t 'devise.sessions.signed_in' end # Scenario: User cannot sign in with wrong email # Given I exist as a user # And I am not signed in # When I sign in with a wrong email # Then I see an invalid email message scenario 'user cannot sign in with wrong email' do user = FactoryGirl.create(:user) signin('invalid@email.com', user.password) expect(page).to have_content I18n.t 'devise.failure.not_found_in_database' end # Scenario: User cannot sign in with wrong password # Given I exist as a user # And I am not signed in # When I sign in with a wrong password # Then I see an invalid password message scenario 'user cannot sign in with wrong password' do user = FactoryGirl.create(:user) signin(user.email, 'invalidpass') expect(page).to have_content I18n.t 'devise.failure.not_found_in_database' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_apps_testing-0.3.9 | lib/generators/testing/configure/templates/spec/devise/features/users/sign_in_spec.rb |