Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-12-22 20:18:22 +0300
committerRobert Speicher <robert@gitlab.com>2017-12-22 20:18:22 +0300
commit87dbf9846dcc870581ed753c730d768e671c51d4 (patch)
treec5fbc5bea4912bb1587720c55462702e9e786a58 /spec
parent77d190b4b4ebd78daa965eb4a2ed4a1e3579d956 (diff)
parent16b8297e77501134cd93a74c3d5c60712930e7fd (diff)
Merge branch 'dm-issue-move-transaction-error' into 'master'
Execute project hooks and services after commit when moving an issue Closes #41324 See merge request gitlab-org/gitlab-ce!16108
Diffstat (limited to 'spec')
-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