Sha256: aa98697b6b56a96c8a4c4b50972da896caa068b24aa97f0513e316e00cdb55ab

Contents?: true

Size: 963 Bytes

Versions: 2

Compression:

Stored size: 963 Bytes

Contents

require 'omniauth'

RSpec.configure do |config|
  config.before(:each, :omniauth => true) do
    OmniAuth.config.test_mode = true

    # the symbol passed to mock_auth is the same as the name of the provider set up in the initializer
    # OmniAuth.config.mock_auth[:google] = {
    #     "provider"=>"google",
    #     "uid"=>"http://xxxx.com/openid?id=118181138998978630963",
    #     "user_info"=>{"email"=>"test@xxxx.com", "first_name"=>"Test", "last_name"=>"User", "name"=>"Test User"}
    # }

    OmniAuth.config.add_mock(:facebook, {
      'uid' => '1234',
      'extra' => {
      'user_hash' => {
        'email' => 'foobar@example.com',
        'first_name' => 'John',
        'last_name' => 'Doe',
        'gender' => 'Male'
        }
      }
    })

    OmniAuth.config.add_mock(:twitter, {
      :uid => '12345',
      :nickname => 'zapnap'
    })
  end

  config.after(:each, :omniauth => true) do
    OmniAuth.config.test_mode = false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
socialite-0.1.0.pre.3 spec/support/omniauth.rb
socialite-0.1.0.pre.2 spec/support/omniauth.rb