diff options
Diffstat (limited to 'spec/presenters/project_hook_presenter_spec.rb')
-rw-r--r-- | spec/presenters/project_hook_presenter_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/presenters/project_hook_presenter_spec.rb b/spec/presenters/project_hook_presenter_spec.rb new file mode 100644 index 00000000000..773e8ccf51e --- /dev/null +++ b/spec/presenters/project_hook_presenter_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ProjectHookPresenter do + 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 + "/#{project.namespace.path}/#{project.name}/hooks/#{web_hook.id}/hook_logs/#{web_hook_log.id}" + 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 + "/#{project.namespace.path}/#{project.name}/hooks/#{web_hook.id}/hook_logs/#{web_hook_log.id}" + end + + it { is_expected.to eq(expected_path) } + end +end |