Commit 1b9c2010 authored by Valery Sizov's avatar Valery Sizov

[Multiple issue assignees] fix some more specs

parent d9240846
......@@ -28,14 +28,14 @@ class IssuesFinder < IssuableFinder
def by_assignee(items)
if assignee
items = items.where("issue_assignees.user_id = ?", assignee.id)
items.assigned_to(assignee)
elsif no_assignee?
items = items.where("issue_assignees.user_id is NULL")
items.unassigned
elsif assignee_id? || assignee_username? # assignee not found
items = items.none
items.none
else
items
end
items
end
def self.not_restricted_by_confidentiality(user)
......
......@@ -22,7 +22,7 @@ module Issues
end
if issue.previous_changes.include?('title') ||
issue.previous_changes.include?('description')
issue.previous_changes.include?('description')
todo_service.update_issue(issue, current_user)
end
......
......@@ -32,7 +32,7 @@ module API
if project.has_external_issue_tracker?
::API::Entities::ExternalIssue
else
::API::Entities::Issue
::API::V3::Entities::Issue
end
end
......
......@@ -39,7 +39,7 @@ module API
end
desc 'Get all issues for a single project milestone' do
success ::API::Entities::Issue
success ::API::V3::Entities::Issue
end
params do
requires :milestone_id, type: Integer, desc: 'The ID of a project milestone'
......@@ -56,7 +56,7 @@ module API
}
issues = IssuesFinder.new(current_user, finder_params).execute
present paginate(issues), with: ::API::Entities::Issue, current_user: current_user, project: user_project
present paginate(issues), with: ::API::V3::Entities::Issue, current_user: current_user, project: user_project
end
end
end
......
......@@ -63,7 +63,7 @@ shared_examples 'issuable record that supports slash commands in its description
note = issuable.notes.user.first
expect(note.note).to eq "Awesome!"
expect(issuable.assignee).to eq assignee
expect(issuable.assignees).to eq [assignee]
expect(issuable.labels).to eq [label_bug]
expect(issuable.milestone).to eq milestone
end
......@@ -81,7 +81,7 @@ shared_examples 'issuable record that supports slash commands in its description
issuable.reload
expect(issuable.notes.user).to be_empty
expect(issuable.assignee).to eq assignee
expect(issuable.assignees).to eq [assignee]
expect(issuable.labels).to eq [label_bug]
expect(issuable.milestone).to eq milestone
end
......
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