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 ServiceHookPresenter do
|
2020-01-01 13:55:28 +05:30
|
|
|
let(:web_hook_log) { create(:web_hook_log, web_hook: service_hook) }
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:service_hook) { create(:service_hook, integration: integration) }
|
|
|
|
let(:integration) { create(:drone_ci_integration, project: project) }
|
2020-01-01 13:55:28 +05:30
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
describe '#logs_details_path' do
|
|
|
|
subject { service_hook.present.logs_details_path(web_hook_log) }
|
|
|
|
|
|
|
|
let(:expected_path) do
|
2023-07-09 08:55:56 +05:30
|
|
|
"/#{project.full_path}/-/settings/integrations/#{integration.to_param}/hook_logs/#{web_hook_log.id}"
|
2020-01-01 13:55:28 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to eq(expected_path) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#logs_retry_path' do
|
|
|
|
subject { service_hook.present.logs_retry_path(web_hook_log) }
|
|
|
|
|
|
|
|
let(:expected_path) do
|
2023-07-09 08:55:56 +05:30
|
|
|
"/#{project.full_path}/-/settings/integrations/#{integration.to_param}/hook_logs/#{web_hook_log.id}/retry"
|
2020-01-01 13:55:28 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to eq(expected_path) }
|
|
|
|
end
|
|
|
|
end
|