Commit a600b4b1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-issue-with-assignee-not-updating' into 'master'

Fixed issue with assignee object not being returned

Closes #15515

See merge request !3877
parents d5398e96 32be8bd2
...@@ -109,7 +109,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -109,7 +109,7 @@ class Projects::IssuesController < Projects::ApplicationController
end end
end end
format.json do format.json do
render json: @issue.to_json(include: [:milestone, labels: { methods: :text_color }, assignee: { methods: :avatar_url }]) render json: @issue.to_json(include: { milestone: {}, assignee: { methods: :avatar_url }, labels: { methods: :text_color } })
end end
end end
end end
......
...@@ -154,7 +154,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -154,7 +154,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.target_project, @merge_request]) @merge_request.target_project, @merge_request])
end end
format.json do format.json do
render json: @merge_request.to_json(include: [:milestone, labels: { methods: :text_color }, assignee: { methods: :avatar_url }]) render json: @merge_request.to_json(include: { milestone: {}, assignee: { methods: :avatar_url }, labels: { methods: :text_color } })
end end
end end
else else
......
...@@ -317,6 +317,27 @@ describe 'Issues', feature: true do ...@@ -317,6 +317,27 @@ describe 'Issues', feature: true do
expect(issue.reload.assignee).to be_nil expect(issue.reload.assignee).to be_nil
end end
it 'allows user to select an assignee', js: true do
issue2 = create(:issue, project: project, author: @user)
visit namespace_project_issue_path(project.namespace, project, issue2)
page.within('.assignee') do
expect(page).to have_content "No assignee"
end
page.within '.assignee' do
click_link 'Edit'
end
page.within '.dropdown-menu-user' do
click_link @user.name
end
page.within('.assignee') do
expect(page).to have_content @user.name
end
end
end end
context 'by unauthorized user' do context 'by unauthorized user' do
......
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