spec/flipper/adapters/http_spec.rb in flipper-0.11.0.beta7 vs spec/flipper/adapters/http_spec.rb in flipper-0.11.0.beta8

- old
+ new

@@ -7,11 +7,11 @@ FLIPPER_SPEC_API_PORT = ENV.fetch('FLIPPER_SPEC_API_PORT', 9001).to_i RSpec.describe Flipper::Adapters::Http do context 'adapter' do subject do - described_class.new(uri: URI("http://localhost:#{FLIPPER_SPEC_API_PORT}")) + described_class.new(url: "http://localhost:#{FLIPPER_SPEC_API_PORT}") end before :all do dir = FlipperRoot.join('tmp').tap(&:mkpath) log_path = dir.join('flipper_adapters_http_spec.log') @@ -64,20 +64,20 @@ } stub_request(:get, "http://app.com/flipper/features/feature_panel") .with(headers: headers) .to_return(status: 404, body: "", headers: {}) - adapter = described_class.new(uri: URI('http://app.com/flipper')) + adapter = described_class.new(url: 'http://app.com/flipper') adapter.get(flipper[:feature_panel]) end describe "#get" do it "raises error when not successful response" do stub_request(:get, "http://app.com/flipper/features/feature_panel") .to_return(status: 503, body: "", headers: {}) - adapter = described_class.new(uri: URI('http://app.com/flipper')) + adapter = described_class.new(url: 'http://app.com/flipper') expect do adapter.get(flipper[:feature_panel]) end.to raise_error(Flipper::Adapters::Http::Error) end end @@ -85,11 +85,11 @@ describe "#get_multi" do it "raises error when not successful response" do stub_request(:get, "http://app.com/flipper/features?keys=feature_panel") .to_return(status: 503, body: "", headers: {}) - adapter = described_class.new(uri: URI('http://app.com/flipper')) + adapter = described_class.new(url: 'http://app.com/flipper') expect do adapter.get_multi([flipper[:feature_panel]]) end.to raise_error(Flipper::Adapters::Http::Error) end end @@ -97,11 +97,11 @@ describe "#get_all" do it "raises error when not successful response" do stub_request(:get, "http://app.com/flipper/features") .to_return(status: 503, body: "", headers: {}) - adapter = described_class.new(uri: URI('http://app.com/flipper')) + adapter = described_class.new(url: 'http://app.com/flipper') expect do adapter.get_all end.to raise_error(Flipper::Adapters::Http::Error) end end @@ -109,21 +109,21 @@ describe "#features" do it "raises error when not successful response" do stub_request(:get, "http://app.com/flipper/features") .to_return(status: 503, body: "", headers: {}) - adapter = described_class.new(uri: URI('http://app.com/flipper')) + adapter = described_class.new(url: 'http://app.com/flipper') expect do adapter.features end.to raise_error(Flipper::Adapters::Http::Error) end end describe 'configuration' do let(:debug_output) { object_double($stderr) } let(:options) do { - uri: URI('http://app.com/mount-point'), + url: 'http://app.com/mount-point', headers: { 'X-Custom-Header' => 'foo' }, basic_auth_username: 'username', basic_auth_password: 'password', read_timeout: 100, open_timeout: 40,