Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module LoginHelper
- # Login shortcut for request specs
- def login(user, check_page=true)
- visit root_path
- fill_in "Email", with: user.email
- fill_in "Password", with: user.password
- click_button "Log in"
- current_path.should eq(dashboard_path) if check_page
- #page.should have_no_content("Invalid")
- end
- # A shortcut for logging out inside request specs
- def logout
- if page.has_link?("Log out")
- click_link "Log out"
- #page.should have_content('Logged out!')
- end
- end
- end
Add Comment
Please, Sign In to add comment