Commit ea843123 authored by Valery Sizov's avatar Valery Sizov

[Multiple issue assignees] Fix spec/services/todo_service_spec.rb

parent f800e8fe
...@@ -240,20 +240,20 @@ describe TodoService, services: true do ...@@ -240,20 +240,20 @@ describe TodoService, services: true do
describe '#reassigned_issue' do describe '#reassigned_issue' do
it 'creates a pending todo for new assignee' do it 'creates a pending todo for new assignee' do
unassigned_issue.update_attribute(:assignee, john_doe) unassigned_issue.assignees << john_doe
service.reassigned_issue(unassigned_issue, author) service.reassigned_issue(unassigned_issue, author)
should_create_todo(user: john_doe, target: unassigned_issue, action: Todo::ASSIGNED) should_create_todo(user: john_doe, target: unassigned_issue, action: Todo::ASSIGNED)
end end
it 'does not create a todo if unassigned' do it 'does not create a todo if unassigned' do
issue.update_attribute(:assignee, nil) issue.assignees.destroy_all
should_not_create_any_todo { service.reassigned_issue(issue, author) } should_not_create_any_todo { service.reassigned_issue(issue, author) }
end end
it 'creates a todo if new assignee is the current user' do it 'creates a todo if new assignee is the current user' do
unassigned_issue.update_attribute(:assignee, john_doe) unassigned_issue.assignees << john_doe
service.reassigned_issue(unassigned_issue, john_doe) service.reassigned_issue(unassigned_issue, john_doe)
should_create_todo(user: john_doe, target: unassigned_issue, author: john_doe, action: Todo::ASSIGNED) should_create_todo(user: john_doe, target: unassigned_issue, author: john_doe, action: Todo::ASSIGNED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment