Sha256: 12651d7468ab6738cce43699e4ff4bca9d1e06f4edcc145a7e26e121a851514a

Contents?: true

Size: 845 Bytes

Versions: 5

Compression:

Stored size: 845 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_success 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

5 entries across 5 versions & 1 rubygems

Version Path
devise_token_auth-0.1.42 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.41 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.40 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.39 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb
devise_token_auth-0.1.38 test/controllers/custom/custom_omniauth_callbacks_controller_test.rb