summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2014-03-05 20:44:01 +0100
committerJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2014-03-05 20:44:01 +0100
commit9a676ccc0a8dd26eb1ebd5042acbf31cfb906f91 (patch)
treeb0679ea1f2a11f608c33a72a4b983bfa1447f424 /spec
parentd02e129a549190c3bd26ed32eac13dfa62f2844d (diff)
downloadgitlab-ce-9a676ccc0a8dd26eb1ebd5042acbf31cfb906f91.tar.gz
Added tag_push_events to the web_hooks
* Added a scope to the web_hooks model * Added extra checkbooks in de hooks overview window
Diffstat (limited to 'spec')
-rw-r--r--spec/models/project_hook_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/project_hook_spec.rb b/spec/models/project_hook_spec.rb
new file mode 100644
index 00000000000..7bd7c431bcd
--- /dev/null
+++ b/spec/models/project_hook_spec.rb
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe ProjectHook do
+ describe '.push_hooks' do
+ it 'should return hooks for push events only' do
+ hook = create(:project_hook, push_events: true)
+ hook2 = create(:project_hook, push_events: false)
+ expect(ProjectHook.push_hooks).to eq([hook])
+ end
+ end
+
+ describe '.tag_push_hooks' do
+ it 'should return hooks for tag push events only' do
+ hook = create(:project_hook, tag_push_events: true)
+ hook2 = create(:project_hook, tag_push_events: false)
+ expect(ProjectHook.tag_push_hooks).to eq([hook])
+ end
+ end
+end