Skip to content

Commit

Permalink
Integration tests for twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal committed Jul 1, 2018
1 parent 0d8477e commit 1154fa0
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 '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 1154fa0

Please sign in to comment.