-
-
Save patricksrobertson/1402155 to your computer and use it in GitHub Desktop.
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
describe "GET /users" do | |
it "lists users if you are logged in" do | |
user1 = Factory(:user, name: "Elliot Stabler") | |
user2 = Factory(:user, name: "Olivia Benson") | |
login_user(user1) | |
login_user(user2) | |
visit users_path | |
page.should_have content(user1.name) | |
page.should_have content(user2.name) | |
end | |
end | |
# extract me into a support file for reusability! | |
def login_user(user) | |
visit new_user_session_path | |
fill_in 'Email', with: user.email | |
fill_in 'Password', with: user.password | |
click_button "Sign in" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment