Sha256: 8f65190c86154867a8ea12358011893b27034bb57b4cc15152690c85827d010b

Contents?: true

Size: 974 Bytes

Versions: 1

Compression:

Stored size: 974 Bytes

Contents

require 'spec_helper'
require 'omniauth-mailchimp'

describe OmniAuth::Strategies::Mailchimp do
  before :each do
    @request = double('Request')
  end
  
  subject do
    OmniAuth::Strategies::Mailchimp.new(nil, @options || {}).tap do |strategy|
      strategy.stub(:request) { @request }
      strategy.stub(:script_name) { "" }
    end
  end

  it_should_behave_like 'an oauth2 strategy'

	describe '#client' do
    it 'has correct Mailchimp api site' do
      subject.options.client_options.site.should eq('https://login.mailchimp.com')
    end

    it 'has correct access token path' do
      subject.options.client_options.token_url.should eq('/oauth2/token')
    end

    it 'has correct authorize url' do
      subject.options.client_options.authorize_url.should eq('/oauth2/authorize')
    end
  end

	describe '#callback_path' do
    it 'should have the correct callback path' do
      subject.callback_path.should eq('/auth/mailchimp/callback')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-mailchimp-2.3.0 spec/omniauth/strategies/mailchimp_spec.rb