Sha256: cb4b51e674588ef3bfbc56f6f8c1bdd43e5a016442b139effa2e639b98ecd342

Contents?: true

Size: 938 Bytes

Versions: 36

Compression:

Stored size: 938 Bytes

Contents

require 'spec_helper'
require 'quick_travel/adapter'
require 'quick_travel/product_type'

describe QuickTravel::Adapter do
  let(:tenant1) { 'http://test.qt.sealink.com.au:8080' }
  let(:tenant2) { 'http://test.qt.other.com.au:8080' }

  let(:qt_keys) { ENV['QT_KEYS'].split(',') }

  it 'should switch bases' do
    VCR.use_cassette 'tenant_switcher' do
      QuickTravel::Adapter.base_uri tenant1
      QuickTravel.config.access_key = qt_keys[0]

      expect(QuickTravel::Adapter.base_uri).to eq tenant1
      QuickTravel::ProductType.find_all!("/api/product_types.json")
      expect(QuickTravel::ProductType.base_uri).to eq tenant1

      QuickTravel::Adapter.base_uri tenant2
      QuickTravel.config.access_key = qt_keys[1]

      expect(QuickTravel::Adapter.base_uri).to eq tenant2
      QuickTravel::ProductType.find_all!("/api/product_types.json")
      expect(QuickTravel::ProductType.base_uri).to eq tenant2
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
quicktravel_client-4.7.0 spec/tenant_spec.rb
quicktravel_client-4.6.0 spec/tenant_spec.rb
quicktravel_client-4.5.0 spec/tenant_spec.rb
quicktravel_client-4.4.0 spec/tenant_spec.rb
quicktravel_client-4.3.2 spec/tenant_spec.rb
quicktravel_client-4.3.1 spec/tenant_spec.rb
quicktravel_client-4.3.0 spec/tenant_spec.rb
quicktravel_client-4.2.0 spec/tenant_spec.rb
quicktravel_client-4.1.0 spec/tenant_spec.rb
quicktravel_client-4.0.0 spec/tenant_spec.rb
quicktravel_client-3.9.0 spec/tenant_spec.rb
quicktravel_client-3.8.1 spec/tenant_spec.rb
quicktravel_client-3.8.0 spec/tenant_spec.rb
quicktravel_client-3.7.0 spec/tenant_spec.rb
quicktravel_client-3.6.1 spec/tenant_spec.rb
quicktravel_client-3.6.0 spec/tenant_spec.rb
quicktravel_client-3.5.0 spec/tenant_spec.rb
quicktravel_client-3.4.0 spec/tenant_spec.rb
quicktravel_client-3.3.0 spec/tenant_spec.rb
quicktravel_client-3.2.0 spec/tenant_spec.rb