Skip to content

Commit

Permalink
Integration tests for twitter (publiclab#2964)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal authored and jywarren committed Jul 2, 2018
1 parent 83d6c7c commit a8d79ee
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit a8d79ee

Please sign in to comment.