Sha256: de0511c28e4ba632d09b8306cc38b35ae9cc0b34c11e56354cd4614f0cf9fcf6

Contents?: true

Size: 991 Bytes

Versions: 5

Compression:

Stored size: 991 Bytes

Contents

##############################################################################
#                             OmniAuth Plugin
##############################################################################

begin
  require 'omniauth'
  require 'rspectacular/mock_authentications/omniauth'

  ###
  # Tell OmniAuth to just return whatever hash we want for each auth type
  #
  OmniAuth.configure do |config|
    config.test_mode            = true
    config.mock_auth[:facebook] = OmniAuth::Facebook::MockAuthentication.user
    config.mock_auth[:twitter]  = OmniAuth::Twitter::MockAuthentication.user
  end

  ###
  # Except we don't want OmniAuth to fake anything when doing live tests
  #
  RSpec.configure do |config|
    config.around(:each, :js => true) do |example|
      previous_omniauth_test_mode = OmniAuth.config.test_mode
      OmniAuth.config.test_mode   = false

      example.run

      OmniAuth.config.test_mode = previous_omniauth_test_mode
    end
  end
rescue LoadError
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspectacular-0.31.0 lib/rspectacular/plugins/omniauth.rb
rspectacular-0.30.0 lib/rspectacular/plugins/omniauth.rb
rspectacular-0.29.0 lib/rspectacular/plugins/omniauth.rb
rspectacular-0.28.0 lib/rspectacular/plugins/omniauth.rb
rspectacular-0.27.0 lib/rspectacular/plugins/omniauth.rb