diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2017-12-04 15:29:13 +0100 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-01-17 09:55:00 +0100 |
commit | a63792b7249d8b49ef9e20ee3bbabd41c22b1ccf (patch) | |
tree | a55194443546f16d5713518d377c75b663513b86 /spec/models/concerns | |
parent | a78abf3a0071d1705adc562f23be1f3a347c6db5 (diff) | |
download | gitlab-ce-a63792b7249d8b49ef9e20ee3bbabd41c22b1ccf.tar.gz |
accepts `.all` as a hook scope as well
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/triggerable_hooks_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/concerns/triggerable_hooks_spec.rb b/spec/models/concerns/triggerable_hooks_spec.rb index 3ddf477e41e..bea846454de 100644 --- a/spec/models/concerns/triggerable_hooks_spec.rb +++ b/spec/models/concerns/triggerable_hooks_spec.rb @@ -26,10 +26,18 @@ RSpec.describe TriggerableHooks do context 'the model does not have the required trigger scope' do it 'returns an empty relation' do - TestableHook.create!(url: 'http://example.com', push_events: true) + TestableHook.create!(url: 'http://example.com') expect(TestableHook.hooks_for(:tag_push_hooks)).to eq [] end end + + context 'the stock scope ".all" is accepted' do + it 'returns the record' do + hook = TestableHook.create!(url: 'http://example.com') + + expect(TestableHook.hooks_for(:all)).to eq [hook] + end + end end end |