diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-07-20 18:12:06 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-20 18:12:06 +0300 |
commit | e0ab5618a0998175df9f90c95ebd35d7afa01db7 (patch) | |
tree | 91cfff5c3c9f6a118d69df5e2816b7461ce2ccc5 /spec/helpers | |
parent | 020b6a0be06614815d96854084f3dcafeefcf0b7 (diff) |
Wrong data type when testing webhooks
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/hooks_helper_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/hooks_helper_spec.rb b/spec/helpers/hooks_helper_spec.rb new file mode 100644 index 00000000000..9f0004bf8cf --- /dev/null +++ b/spec/helpers/hooks_helper_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe HooksHelper do + let(:project) { create(:empty_project) } + 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 |