summaryrefslogtreecommitdiff
path: root/spec/helpers/hooks_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/hooks_helper_spec.rb')
-rw-r--r--spec/helpers/hooks_helper_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/hooks_helper_spec.rb b/spec/helpers/hooks_helper_spec.rb
index 3b23d705790..bac73db5dd4 100644
--- a/spec/helpers/hooks_helper_spec.rb
+++ b/spec/helpers/hooks_helper_spec.rb
@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe HooksHelper do
let(:project) { create(:project) }
let(:project_hook) { create(:project_hook, project: project) }
+ let(:service_hook) { create(:service_hook, integration: create(:drone_ci_integration)) }
let(:system_hook) { create(:system_hook) }
describe '#link_to_test_hook' do
@@ -31,6 +32,15 @@ RSpec.describe HooksHelper do
end
end
+ context 'with a service hook' do
+ let(:web_hook_log) { create(:web_hook_log, web_hook: service_hook) }
+
+ it 'returns project-namespaced link' do
+ expect(helper.hook_log_path(project_hook, web_hook_log))
+ .to eq(web_hook_log.present.details_path)
+ end
+ end
+
context 'with a system hook' do
let(:web_hook_log) { create(:web_hook_log, web_hook: system_hook) }