summaryrefslogtreecommitdiff
path: root/spec/services/issues
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-12-22 11:38:35 +0100
committerDouwe Maan <douwe@selenight.nl>2017-12-22 17:19:50 +0100
commit16b8297e77501134cd93a74c3d5c60712930e7fd (patch)
tree8373c955431ee30156423626a561ca2cf599e47c /spec/services/issues
parent92e15071c13f65cf7250315f1a138284880b0074 (diff)
downloadgitlab-ce-16b8297e77501134cd93a74c3d5c60712930e7fd.tar.gz
Execute project hooks and services after commit when moving an issuedm-issue-move-transaction-error
Diffstat (limited to 'spec/services/issues')
-rw-r--r--spec/services/issues/move_service_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb
index f2b35a8fadf..2cad695d7c4 100644
--- a/spec/services/issues/move_service_spec.rb
+++ b/spec/services/issues/move_service_spec.rb
@@ -289,6 +289,18 @@ describe Issues::MoveService do
.to raise_error(StandardError, /Cannot move issue/)
end
end
+
+ context 'project issue hooks' do
+ let(:hook) { create(:project_hook, project: old_project, issues_events: true) }
+
+ it 'executes project issue hooks' do
+ # Ideally, we'd test that `WebHookWorker.jobs.size` increased by 1,
+ # but since the entire spec run takes place in a transaction, we never
+ # actually get to the `after_commit` hook that queues these jobs.
+ expect { move_service.execute(old_issue, new_project) }
+ .not_to raise_error # Sidekiq::Worker::EnqueueFromTransactionError
+ end
+ end
end
describe 'move permissions' do