features/login_tests/admin_login.feature
# As a member of 180-Degrees Consulting
# I want to be able to log in as an admin, so I can view important info for members.
Feature: login page
As a member of 180-Degrees Consulting
I want to be able to log in as an admin,
so I can view important info for members.
Background:
# Given I am not logged in
Given the following users exist:
| email | password | member_type |
| admin@berkeley.edu | password123 | admin |
| member@berkeley.edu | password123 | member |
# going to the login page
# Happy path:
Scenario: logging in successfully
Given I am on the home page
And I follow "Login"
Then I should be on the new_user_session page
And I fill in "Email" with "admin@berkeley.edu"
And I fill in "Password" with "password123"
And I press "Log in"
Then I should see "Signed in successfully."
And I follow "Admin"
# Sad path:
Scenario: failed application
Given I am on the home page
And I follow "Login"
Then I should be on the new_user_session page
And I fill in "Email" with "rowan@funion.com"
And I press "Log in"
Then I should see "Invalid email or password."