diff --git a/test/integration/login_flow_test.rb b/test/integration/login_flow_test.rb index 396595a9a11..18722c0b034 100644 --- a/test/integration/login_flow_test.rb +++ b/test/integration/login_flow_test.rb @@ -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