Skip to content

Instantly share code, notes, and snippets.

@mikegehard
Created March 3, 2011 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikegehard/853253 to your computer and use it in GitHub Desktop.
Save mikegehard/853253 to your computer and use it in GitHub Desktop.
Testing OmniAuth login via cucumber...
Before('@omniauth_test') do
OmniAuth.config.test_mode = true
# the symbol passed to mock_auth is the same as the name of the provider set up in the initializer
OmniAuth.config.mock_auth[:google] = {
"provider"=>"google",
"uid"=>"http://xxxx.com/openid?id=118181138998978630963",
"user_info"=>{"email"=>"test@xxxx.com", "first_name"=>"Test", "last_name"=>"User", "name"=>"Test User"}
}
end
After('@omniauth_test') do
OmniAuth.config.test_mode = false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment