Sha256: 904731599c9ce89436c712dc1178704711661c2eb5f99c5ddd8ce164b89f6502
Contents?: true
Size: 1.53 KB
Versions: 2
Compression:
Stored size: 1.53 KB
Contents
require 'helper' require 'flipper/cloud' RSpec.describe Flipper::Cloud do context "initialize with token" do let(:token) { 'asdf' } before do @instance = described_class.new(token) memoized_adapter = @instance.adapter @http_adapter = memoized_adapter.adapter @http_client = @http_adapter.instance_variable_get('@client') end it 'returns Flipper::DSL instance' do expect(@instance).to be_instance_of(Flipper::DSL) end it 'configures instance to use http adapter' do expect(@http_adapter).to be_instance_of(Flipper::Adapters::Http) end it 'sets up correct url' do uri = @http_client.instance_variable_get('@uri') expect(uri.scheme).to eq('https') expect(uri.host).to eq('www.featureflipper.com') expect(uri.path).to eq('/adapter') end it 'sets correct token header' do headers = @http_client.instance_variable_get('@headers') expect(headers['Feature-Flipper-Token']).to eq(token) end end context 'initialize with token and options' do before do @instance = described_class.new('asdf', url: 'https://www.fakeflipper.com/sadpanda') memoized_adapter = @instance.adapter @http_adapter = memoized_adapter.adapter @http_client = @http_adapter.instance_variable_get('@client') end it 'sets correct url' do uri = @http_client.instance_variable_get('@uri') expect(uri.scheme).to eq('https') expect(uri.host).to eq('www.fakeflipper.com') expect(uri.path).to eq('/sadpanda') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
flipper-cloud-0.11.0.beta3 | spec/flipper/cloud_spec.rb |
flipper-cloud-0.11.0.beta1 | spec/flipper/cloud_spec.rb |