diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-09-14 15:22:57 +0300 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-01-04 11:33:41 +0300 |
commit | b22ae0c00eaa6bad6e664953167022d17c196d8d (patch) | |
tree | 5b2146275ec7f0a836a9f3462ca219afffa045ff /spec/models/project_spec.rb | |
parent | 9f7811e474a3f3f54f4624d19ec982239518ed67 (diff) |
invoke SystemHooksService instead of direct model
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 339186e25ae..e3899cc9bff 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3190,14 +3190,10 @@ describe Project do end it 'executes the system hooks with the specified scope' do - create :system_hook, merge_requests_events: true, tag_push_events: false - create :system_hook, merge_requests_events: false, tag_push_events: true - allow_any_instance_of(SystemHook).to receive(:async_execute).once - project = create :project + expect_any_instance_of(SystemHooksService).to receive(:execute_hooks).with({ data: 'data' }, :merge_request_hooks) - expect_any_instance_of(SystemHook).to receive(:async_execute).once - - project.execute_hooks({}, :tag_push_hooks) + project = build(:project) + project.execute_hooks({ data: 'data' }, :merge_request_hooks) end end end |