Sha256: 6a488f4bc121bdc329206f5084e8074e0b39eecfad6c4115be4b3fdb121e6a2d

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe MarketingCloudSDK::Client do

  context 'Empty string REST endpoint, no Auth attribute' do

    client1 = MarketingCloudSDK::Client.new 'client' => {'id' => '1234', 'secret' => 'ssssh',
                                                        'base_api_url' => ''}

    it 'Should use REST endpoint default value if base_api_url endpoint is an empty string in config' do
      expect(client1.base_api_url).to eq 'https://www.exacttargetapis.com'
    end

    it 'Should use Auth endpoint default value if request_token_url attribute is not in config' do
      expect(client1.request_token_url).to eq 'https://auth.exacttargetapis.com/v1/requestToken'
    end
  end

  context 'Blank string REST endpoint' do

    client2 = MarketingCloudSDK::Client.new 'client' => {'id' => '1234', 'secret' => 'ssssh',
                                                         'base_api_url' => '   '}

    it 'Should use REST endpoint default value if REST endpoint is a blank string in config' do
      expect(client2.base_api_url).to eq 'https://www.exacttargetapis.com'
    end

  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
sfmc-fuelsdk-ruby-1.3.1 spec/default_values_fallback_spec.rb
sfmc-fuelsdk-ruby-1.1.0 spec/default_values_fallback_spec.rb
dragostsesdk-1.1.0 spec/default_values_fallback_spec.rb