2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe WebHookLogPresenter do
|
2020-01-01 13:55:28 +05:30
|
|
|
include Gitlab::Routing.url_helpers
|
|
|
|
|
|
|
|
describe '#details_path' do
|
|
|
|
let(:web_hook_log) { create(:web_hook_log, web_hook: web_hook) }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
subject { web_hook_log.present.details_path }
|
|
|
|
|
|
|
|
context 'project hook' do
|
|
|
|
let(:web_hook) { create(:project_hook, project: project) }
|
|
|
|
|
|
|
|
it { is_expected.to eq(project_hook_hook_log_path(project, web_hook, web_hook_log)) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'service hook' do
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:web_hook) { create(:service_hook, integration: integration) }
|
|
|
|
let(:integration) { create(:drone_ci_integration, project: project) }
|
2020-01-01 13:55:28 +05:30
|
|
|
|
2022-07-23 23:45:48 +05:30
|
|
|
it { is_expected.to eq(project_settings_integration_hook_log_path(project, integration, web_hook_log)) }
|
2020-01-01 13:55:28 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#retry_path' do
|
|
|
|
let(:web_hook_log) { create(:web_hook_log, web_hook: web_hook) }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
subject { web_hook_log.present.retry_path }
|
|
|
|
|
|
|
|
context 'project hook' do
|
|
|
|
let(:web_hook) { create(:project_hook, project: project) }
|
|
|
|
|
|
|
|
it { is_expected.to eq(retry_project_hook_hook_log_path(project, web_hook, web_hook_log)) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'service hook' do
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:web_hook) { create(:service_hook, integration: integration) }
|
|
|
|
let(:integration) { create(:drone_ci_integration, project: project) }
|
2020-01-01 13:55:28 +05:30
|
|
|
|
2022-07-23 23:45:48 +05:30
|
|
|
it { is_expected.to eq(retry_project_settings_integration_hook_log_path(project, integration, web_hook_log)) }
|
2020-01-01 13:55:28 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|