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