Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Koltsov <gkoltsov@gitlab.com>2019-07-30 13:53:23 +0300
committerGeorge Koltsov <gkoltsov@gitlab.com>2019-08-02 17:39:18 +0300
commit8abf920d1f55e9117dd3b05d81ee9ebf7721f2bd (patch)
treebcdc229c8b9819f0ff6f5dc99095fe40bbeff51c /spec/services
parentac7661924eebd6eb0fa72848e2b4bf4391ebf113 (diff)
Refactor SystemHookUrlValidator and specs
Simplify SystemHookUrlValidator to inherit from PublicUrlValidator Refactor specs to move out shared examples to be used in both system hooks and public url validators.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/web_hook_service_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb
index 115599bd1a4..50167a2e059 100644
--- a/spec/services/web_hook_service_spec.rb
+++ b/spec/services/web_hook_service_spec.rb
@@ -23,14 +23,14 @@ describe WebHookService do
stub_application_setting(setting_name => setting)
end
- shared_examples_for 'respecting outbound network setting' do
- context 'local requests are allowed' do
+ shared_examples_for 'respects outbound network setting' do
+ context 'when local requests are allowed' do
let(:setting) { true }
it { expect(hook.request_options[:allow_local_requests]).to be_truthy }
end
- context 'local requests are not allowed' do
+ context 'when local requests are not allowed' do
let(:setting) { false }
it { expect(hook.request_options[:allow_local_requests]).to be_falsey }
@@ -41,14 +41,14 @@ describe WebHookService do
let(:setting_name) { :allow_local_requests_from_system_hooks }
let(:hook) { described_class.new(build(:system_hook), data, :system_hook) }
- include_examples 'respecting outbound network setting'
+ include_examples 'respects outbound network setting'
end
context 'when ProjectHook' do
let(:setting_name) { :allow_local_requests_from_web_hooks_and_services }
let(:hook) { described_class.new(build(:project_hook), data, :project_hook) }
- include_examples 'respecting outbound network setting'
+ include_examples 'respects outbound network setting'
end
end