Sha256: 244776644e2e7f0a9664409193dc8ee44bc26b42bfc86fa827b27565abeabdfb

Contents?: true

Size: 844 Bytes

Versions: 9

Compression:

Stored size: 844 Bytes

Contents

require 'test_helper'

class Custom::OmniauthCallbacksControllerTest < ActionDispatch::IntegrationTest

  describe Custom::OmniauthCallbacksController do

    setup do
      OmniAuth.config.test_mode = true
      OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({
        :provider => 'facebook',
        :uid => '123545',
        :info => {
          name: 'swong',
          email: 'swongsong@yandex.ru'
        }
      })
    end

    test "yield resource to block on omniauth_sucess success" do
      @redirect_url = "http://ng-token-auth.dev/"
      get_via_redirect '/nice_user_auth/facebook', {
        auth_origin_url: @redirect_url,
        omniauth_window_type: 'newWindow'
      }
      assert @controller.omniauth_success_block_called?, "omniauth_success failed to yield resource to provided block"
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
devise_token_auth-0.1.37 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.37.beta4 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.37.beta3 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.37.beta2 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.37.beta1 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.36 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.35 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.34 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.33 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb