Skip to content

Commit

Permalink
Integration tests for facebook (publiclab#2963)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal authored and jywarren committed Jul 2, 2018
1 parent df12d7a commit 4cfc44a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/integration/login_flow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,20 @@ class LoginFlowTest < ActionDispatch::IntegrationTest
request.env['omniauth.auth'] = OmniAuth.config.mock_auth[:github2]
assert_not_nil request.env['omniauth.auth']
end

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

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

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

0 comments on commit 4cfc44a

Please sign in to comment.