Commit e0b9fa32 authored by Valery Sizov's avatar Valery Sizov

[Multiple issue assignees] fix specs

parent dc6e65da
...@@ -40,7 +40,7 @@ module Milestoneish ...@@ -40,7 +40,7 @@ module Milestoneish
def issues_visible_to_user(user) def issues_visible_to_user(user)
memoize_per_user(user, :issues_visible_to_user) do memoize_per_user(user, :issues_visible_to_user) do
IssuesFinder.new(user, issues_finder_params) IssuesFinder.new(user, issues_finder_params)
.execute.where(milestone_id: milestoneish_ids) .execute.includes(:assignees).where(milestone_id: milestoneish_ids)
end end
end end
......
...@@ -6,7 +6,7 @@ describe 'Unsubscribe links', feature: true do ...@@ -6,7 +6,7 @@ describe 'Unsubscribe links', feature: true do
let(:recipient) { create(:user) } let(:recipient) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let(:params) { { title: 'A bug!', description: 'Fix it!', assignee: recipient } } let(:params) { { title: 'A bug!', description: 'Fix it!', assignees: [recipient] } }
let(:issue) { Issues::CreateService.new(project, author, params).execute } let(:issue) { Issues::CreateService.new(project, author, params).execute }
let(:mail) { ActionMailer::Base.deliveries.last } let(:mail) { ActionMailer::Base.deliveries.last }
......
...@@ -21,11 +21,11 @@ describe MergeRequests::AssignIssuesService, services: true do ...@@ -21,11 +21,11 @@ describe MergeRequests::AssignIssuesService, services: true do
expect(service.assignable_issues).to be_empty expect(service.assignable_issues).to be_empty
end end
it 'ignores issues already assigned to any user' do it 'ignores issues already assigned to any user' do
issue.assignees = [create(:user)] issue.assignees = [create(:user)]
expect(service.assignable_issues).to be_empty expect(service.assignable_issues).to be_empty
end end
it 'ignores all issues unless current_user is merge_request.author' do it 'ignores all issues unless current_user is merge_request.author' do
merge_request.update!(author: create(:user)) merge_request.update!(author: create(:user))
......
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