Commit 91f693c0 authored by Long Nguyen's avatar Long Nguyen

Update changelog, improve specs

parent f43044cc
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.8.0 (unreleased) v 8.8.0 (unreleased)
- Assign labels and milestone to target project when moving issue. !3934 - Assign labels and milestone to target project when moving issue. !3934 (Long Nguyen)
- Remove future dates from contribution calendar graph. - Remove future dates from contribution calendar graph.
- Fix error when visiting commit builds page before build was updated - Fix error when visiting commit builds page before build was updated
- Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project - Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project
......
...@@ -46,7 +46,7 @@ module Issues ...@@ -46,7 +46,7 @@ module Issues
project: @new_project, author: @old_issue.author, project: @new_project, author: @old_issue.author,
description: rewrite_content(@old_issue.description) } description: rewrite_content(@old_issue.description) }
new_params = @old_issue.serializable_hash.merge(new_params) new_params = @old_issue.serializable_hash.symbolize_keys.merge(new_params)
CreateService.new(@new_project, @current_user, new_params).execute CreateService.new(@new_project, @current_user, new_params).execute
end end
......
...@@ -7,9 +7,7 @@ describe Issues::MoveService, services: true do ...@@ -7,9 +7,7 @@ describe Issues::MoveService, services: true do
let(:description) { 'Some issue description' } let(:description) { 'Some issue description' }
let(:old_project) { create(:project) } let(:old_project) { create(:project) }
let(:new_project) { create(:project) } let(:new_project) { create(:project) }
let!(:milestone1) do let(:milestone1) { create(:milestone, project_id: old_project.id, title: 'v9.0') }
create(:milestone, project_id: old_project.id, title: 'v9.0')
end
let(:old_issue) do let(:old_issue) do
create(:issue, title: title, description: description, create(:issue, title: title, description: description,
...@@ -57,6 +55,7 @@ describe Issues::MoveService, services: true do ...@@ -57,6 +55,7 @@ describe Issues::MoveService, services: true do
it 'assigns milestone to new issue' do it 'assigns milestone to new issue' do
expect(new_issue.reload.milestone.title).to eq 'v9.0' expect(new_issue.reload.milestone.title).to eq 'v9.0'
expect(new_issue.reload.milestone).to eq(milestone2)
end end
it 'assign labels to new issue' do it 'assign labels to new issue' do
...@@ -64,6 +63,11 @@ describe Issues::MoveService, services: true do ...@@ -64,6 +63,11 @@ describe Issues::MoveService, services: true do
expect(expected_label_titles).to include 'label1' expect(expected_label_titles).to include 'label1'
expect(expected_label_titles).to include 'label2' expect(expected_label_titles).to include 'label2'
expect(expected_label_titles.size).to eq 2 expect(expected_label_titles.size).to eq 2
new_issue.labels.each do |label|
expect(new_project.labels).to include(label)
expect(old_project.labels).not_to include(label)
end
end end
it 'rewrites issue title' do it 'rewrites issue title' 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