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 ProjectHookPresenter do
|
2019-12-17 10:08:15 -05:00
|
|
|
let(:web_hook_log) { create(:web_hook_log) }
|
|
|
|
let(:project) { web_hook_log.web_hook.project }
|
|
|
|
let(:web_hook) { web_hook_log.web_hook }
|
|
|
|
|
|
|
|
describe '#logs_details_path' do
|
|
|
|
subject { web_hook.present.logs_details_path(web_hook_log) }
|
|
|
|
|
|
|
|
let(:expected_path) do
|
2021-03-29 20:09:26 -04:00
|
|
|
"/#{project.namespace.path}/#{project.name}/-/hooks/#{web_hook.id}/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 { web_hook.present.logs_details_path(web_hook_log) }
|
|
|
|
|
|
|
|
let(:expected_path) do
|
2021-03-29 20:09:26 -04:00
|
|
|
"/#{project.namespace.path}/#{project.name}/-/hooks/#{web_hook.id}/hook_logs/#{web_hook_log.id}"
|
2019-12-17 10:08:15 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to eq(expected_path) }
|
|
|
|
end
|
|
|
|
end
|