Feature: login a user As an unlogged in guest I want to login to my account Background: Given I am not logged in Scenario: Visit login When I am on the user login page Then I should see the view "users/login_form" Then the "Email or Login Name" field should be required Then the "Email or Login Name" field should be blank Then the "Password" field should be required Then the "Password" field should be blank Then the "Remember Me" field should be blank Then I should see the "Forgot Password?" link to the user pswd forgot page Then I should see the "Login" button Scenario: Login with the correct details Given there is a user with email "bill@smith.com" and password "smitty" Given I am on the user login page Given I fill in "Email or Login Name" with "bill@smith.com" Given I fill in "Password" with "smitty" When I press "Login" Then I should be on the root page Then I should be logged in Scenario: Login with the wrong details Given there is a user with email "bill@smith.com" and password "smitty" Given I am on the user login page Given I fill in "Email or Login Name" with "bill@smith.com" Given I fill in "Password" with "wrong" When I press "Login" Then I should be on the user login page Then I should not be logged in Scenario: Login as a disabled user Given there is a disabled user with email "bill@smith.com" and password "smitty" Given I am on the user login page Given I fill in "Email or Login Name" with "bill@smith.com" Given I fill in "Password" with "smitty" When I press "Login" Then I should be on the home page Then the error message should not be blank Then I should not be logged in Scenario: Login with remember me set Given there is a user with email "bill@smith.com" and password "smitty" Given I am on the user login page Given I fill in "Email or Login Name" with "bill@smith.com" Given I fill in "Password" with "smitty" Given I check "Remember Me" When I press "Login" Then I should be logged in Then the remember me token should be set Scenario: remember me previously set Given there is a user with email "bill@smith.com" and password "smitty" Given I am on the user login page Given I fill in "Email or Login Name" with "bill@smith.com" Given I fill in "Password" with "smitty" Given I check "Remember Me" Given I press "Login" When I go to the user logout page Then the remember me token should be set