diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-05-07 02:31:56 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-05-07 02:37:29 +0300 |
commit | ab4671f26ab789b1e3647754911197aaba1f81bb (patch) | |
tree | 686244985b9e178a5d59dd7cf202d75fc7e55cc9 /spec/services/todo_service_spec.rb | |
parent | 2e1162272e2f90a3677f3def491907729b249434 (diff) |
Fix adding a todo for private group members
Fixes #14002
Diffstat (limited to 'spec/services/todo_service_spec.rb')
-rw-r--r-- | spec/services/todo_service_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index 82b7fbfa816..a075496ee63 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -55,6 +55,25 @@ describe TodoService, services: true do should_create_todo(user: admin, target: confidential_issue, author: john_doe, action: Todo::MENTIONED) should_not_create_todo(user: john_doe, target: confidential_issue, author: john_doe, action: Todo::MENTIONED) end + + context 'when a private group is mentioned' do + let(:group) { create :group, :private } + let(:project) { create :project, :private, group: group } + let(:issue) { create :issue, author: author, project: project, description: group.to_reference } + + before do + group.add_owner(author) + group.add_user(member, Gitlab::Access::DEVELOPER) + group.add_user(john_doe, Gitlab::Access::DEVELOPER) + + service.new_issue(issue, author) + end + + it 'creates a todo for group members' do + should_create_todo(user: member, target: issue) + should_create_todo(user: john_doe, target: issue) + end + end end describe '#update_issue' do |