diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-17 02:01:14 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 17:10:26 +0300 |
commit | 802bf6d012bf8edb8ea35429bd8b8cc4fe8e9bf1 (patch) | |
tree | 79660e9c36e03d3b98731664bd5b91cf10be9bac /spec/services/merge_requests/update_service_spec.rb | |
parent | 9da03c45c9e313e8adb170ee9933bd94efbf747c (diff) |
Create a pending task when an MR is assigned to someone
Diffstat (limited to 'spec/services/merge_requests/update_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index 2e9e6e0870d..88853483784 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -98,6 +98,31 @@ describe MergeRequests::UpdateService, services: true do end end + context 'task queue' do + let!(:pending_task) do + create(:pending_assigned_task, user: user, project: project, target: merge_request, author: user2) + end + + context 'when is reassigned' do + before do + update_merge_request({ assignee: user2 }) + end + + it 'creates a pending task for new assignee' do + attributes = { + project: project, + author: user, + user: user2, + target: merge_request, + action: Task::ASSIGNED, + state: :pending + } + + expect(Task.where(attributes).count).to eq 1 + end + end + end + context 'when MergeRequest has tasks' do before { update_merge_request({ description: "- [ ] Task 1\n- [ ] Task 2" }) } |