2011-09-03 14:08:07 -04:00
|
|
|
module OmniAuth
|
|
|
|
|
|
|
|
module Test
|
|
|
|
|
|
|
|
module StrategyMacros
|
|
|
|
|
|
|
|
def sets_an_auth_hash
|
2012-10-10 04:32:55 -04:00
|
|
|
it "sets an auth hash" do
|
|
|
|
expect(last_request.env['omniauth.auth']).to be_kind_of(Hash)
|
2011-09-03 14:08:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def sets_provider_to(provider)
|
2012-10-10 04:32:55 -04:00
|
|
|
it "sets the provider to #{provider}" do
|
|
|
|
expect((last_request.env['omniauth.auth'] || {})['provider']).to eq provider
|
2011-09-03 14:08:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def sets_uid_to(uid)
|
2012-10-10 04:32:55 -04:00
|
|
|
it "sets the UID to #{uid}" do
|
|
|
|
expect((last_request.env['omniauth.auth'] || {})['uid']).to eq uid
|
2011-09-03 14:08:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def sets_user_info_to(user_info)
|
2012-10-10 04:32:55 -04:00
|
|
|
it "sets the user_info to #{user_info}" do
|
|
|
|
expect((last_request.env['omniauth.auth'] || {})['user_info']).to eq user_info
|
2011-09-03 14:08:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|