Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests for facebook #2964

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/integration/login_flow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,21 @@ class LoginFlowTest < ActionDispatch::IntegrationTest
request.env['omniauth.auth'] = OmniAuth.config.mock_auth[:twitter2]
assert_not_nil request.env['omniauth.auth']
end

test 'facebook login routing' do
assert_routing '/auth/facebook/callback', {controller: 'user_sessions', action: 'create',provider: 'facebook'}
end

test 'facebook login post' do
assert_routing({path: '/auth/facebook/callback', method: 'post'},{controller: 'user_sessions', action: 'create' ,provider: 'facebook'})
end

test 'should get oauth hash from /auth/facebook' do
get '/auth/facebook'
assert_redirected_to '/auth/facebook/callback'
assert_not_nil OmniAuth.config.mock_auth[:facebook2]
request.env['omniauth.auth'] = OmniAuth.config.mock_auth[:facebook2]
assert_not_nil request.env['omniauth.auth']
end

end