2019-09-30 12:06:01 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-20 15:12:06 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe HooksHelper do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project) }
|
2017-07-20 15:12:06 +00:00
|
|
|
let(:project_hook) { create(:project_hook, project: project) }
|
|
|
|
let(:system_hook) { create(:system_hook) }
|
|
|
|
let(:trigger) { 'push_events' }
|
|
|
|
|
|
|
|
describe '#link_to_test_hook' do
|
|
|
|
it 'returns project namespaced link' do
|
|
|
|
expect(helper.link_to_test_hook(project_hook, trigger))
|
|
|
|
.to include("href=\"#{test_project_hook_path(project, project_hook, trigger: trigger)}\"")
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns admin namespaced link' do
|
|
|
|
expect(helper.link_to_test_hook(system_hook, trigger))
|
|
|
|
.to include("href=\"#{test_admin_hook_path(system_hook, trigger: trigger)}\"")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|