summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-18 18:09:21 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-20 12:12:05 -0200
commit44656136475d8842628d0a1112aecc9ec412a16f (patch)
treeefd13354ac1292ee7443222e2267e2bfa2632ea7 /spec
parent424cb9ccaef35717bd934dd48f8bd69515210a50 (diff)
downloadgitlab-ce-44656136475d8842628d0a1112aecc9ec412a16f.tar.gz
Explicit mention of the assignee make a task
Since potentially the previous assign-task has already been handled.
Diffstat (limited to 'spec')
-rw-r--r--spec/services/task_service_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/services/task_service_spec.rb b/spec/services/task_service_spec.rb
index a5a497c7002..75498514093 100644
--- a/spec/services/task_service_spec.rb
+++ b/spec/services/task_service_spec.rb
@@ -56,15 +56,15 @@ describe TaskService, services: true do
service.update_issue(issue, author)
should_create_task(user: michael, target: issue, action: Task::MENTIONED)
+ should_create_task(user: john_doe, target: issue, action: Task::MENTIONED)
should_not_create_task(user: author, target: issue, action: Task::MENTIONED)
- should_not_create_task(user: john_doe, target: issue, action: Task::MENTIONED)
should_not_create_task(user: stranger, target: issue, action: Task::MENTIONED)
end
it 'does not create a task if user was already mentioned' do
create(:task, :mentioned, user: michael, project: project, target: issue, author: author)
- should_not_create_any_task { service.update_issue(issue, author) }
+ expect { service.update_issue(issue, author) }.not_to change(michael.tasks, :count)
end
end
@@ -184,15 +184,15 @@ describe TaskService, services: true do
service.update_merge_request(mr_assigned, author)
should_create_task(user: michael, target: mr_assigned, action: Task::MENTIONED)
+ should_create_task(user: john_doe, target: mr_assigned, action: Task::MENTIONED)
should_not_create_task(user: author, target: mr_assigned, action: Task::MENTIONED)
- should_not_create_task(user: john_doe, target: mr_assigned, action: Task::MENTIONED)
should_not_create_task(user: stranger, target: mr_assigned, action: Task::MENTIONED)
end
it 'does not create a task if user was already mentioned' do
create(:task, :mentioned, user: michael, project: project, target: mr_assigned, author: author)
- should_not_create_any_task { service.update_merge_request(mr_assigned, author) }
+ expect { service.update_merge_request(mr_assigned, author) }.not_to change(michael.tasks, :count)
end
end