Created
June 26, 2012 09:07
-
-
Save piotrze/2994577 to your computer and use it in GitHub Desktop.
Rspec helper for sign_in with clearance and facebook-omniauth
This file contains hidden or 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
#spec/support/prefork/request_helpers.rb | |
module RequestHelpers | |
def sign_in_as(user, password = "password") | |
OmniAuth.config.add_mock(:facebook, {"uid" => user.facebook_uid}) | |
visit root_path | |
click_link "Sign in" | |
ensure_signed_in | |
end | |
def ensure_signed_in | |
visit root_path | |
wait_until {page.should have_content "Sign out"} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment