summaryrefslogtreecommitdiff
path: root/qa/spec/runtime/application_settings_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/runtime/application_settings_spec.rb')
-rw-r--r--qa/spec/runtime/application_settings_spec.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/qa/spec/runtime/application_settings_spec.rb b/qa/spec/runtime/application_settings_spec.rb
index 5c4947f6f70..d387bf0995a 100644
--- a/qa/spec/runtime/application_settings_spec.rb
+++ b/qa/spec/runtime/application_settings_spec.rb
@@ -1,14 +1,10 @@
# frozen_string_literal: true
RSpec.describe QA::Runtime::ApplicationSettings do
- let(:api_client) { double('QA::Runtime::API::Client') }
+ let(:api_client) { instance_double(QA::Runtime::API::Client) }
let(:request) { Struct.new(:url).new('http://api') }
let(:get_response) { Struct.new(:body).new("{}") }
- before do
- allow(described_class).to receive(:api_client).and_return(api_client)
- end
-
describe '.set_application_settings' do
it 'sets application settings' do
expect(QA::Runtime::API::Request)
@@ -23,7 +19,10 @@ RSpec.describe QA::Runtime::ApplicationSettings do
.with(request.url, { allow_local_requests_from_web_hooks_and_services: true })
.and_return(Struct.new(:code).new(200))
- described_class.set_application_settings(allow_local_requests_from_web_hooks_and_services: true)
+ described_class.set_application_settings(
+ api_client: api_client,
+ allow_local_requests_from_web_hooks_and_services: true
+ )
end
end
@@ -39,7 +38,7 @@ RSpec.describe QA::Runtime::ApplicationSettings do
.with(request.url)
.and_return(get_response)
- described_class.get_application_settings
+ described_class.get_application_settings(api_client: api_client)
end
end
end