2019-12-17 10:08:15 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe ServiceHookPresenter do
|
2019-12-17 10:08:15 -05:00
|
|
|
let(:web_hook_log) { create(:web_hook_log, web_hook: service_hook) }
|
2021-06-15 20:10:15 -04:00
|
|
|
let(:service_hook) { create(:service_hook, integration: integration) }
|
|
|
|
let(:integration) { create(:drone_ci_integration, project: project) }
|
2019-12-17 10:08:15 -05:00
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
describe '#logs_details_path' do
|
|
|
|
subject { service_hook.present.logs_details_path(web_hook_log) }
|
|
|
|
|
|
|
|
let(:expected_path) do
|
2021-12-30 13:13:34 -05:00
|
|
|
"/#{project.namespace.path}/#{project.name}/-/integrations/#{integration.to_param}/hook_logs/#{web_hook_log.id}"
|
2019-12-17 10:08:15 -05:00
|
|
|
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
|
2021-12-30 13:13:34 -05:00
|
|
|
"/#{project.namespace.path}/#{project.name}/-/integrations/#{integration.to_param}/hook_logs/#{web_hook_log.id}/retry"
|
2019-12-17 10:08:15 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to eq(expected_path) }
|
|
|
|
end
|
|
|
|
end
|