Commit f5e4adc9 authored by James Lopez's avatar James Lopez

add spec replicating both label and milestone duplicated title issues

parent a170c587
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"milestones": [ "milestones": [
{ {
"id": 1, "id": 1,
"title": "Project milestone", "title": "A milestone",
"project_id": 8, "project_id": 8,
"description": "Project-level milestone", "description": "Project-level milestone",
"due_date": null, "due_date": null,
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"group_milestone_id": null, "group_milestone_id": null,
"milestone": { "milestone": {
"id": 1, "id": 1,
"title": "Project milestone", "title": "A milestone",
"project_id": 8, "project_id": 8,
"description": "Project-level milestone", "description": "Project-level milestone",
"due_date": null, "due_date": null,
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
"updated_at": "2017-08-15T18:37:40.795Z", "updated_at": "2017-08-15T18:37:40.795Z",
"label": { "label": {
"id": 6, "id": 6,
"title": "Another project label", "title": "Another label",
"color": "#A8D695", "color": "#A8D695",
"project_id": null, "project_id": null,
"created_at": "2017-08-15T18:37:19.698Z", "created_at": "2017-08-15T18:37:19.698Z",
......
...@@ -368,5 +368,38 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -368,5 +368,38 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
milestones: 1, milestones: 1,
first_issue_labels: 1 first_issue_labels: 1
end end
context 'with existing group models' do
let!(:project) do
create(:project,
:builds_disabled,
:issues_disabled,
name: 'project',
path: 'project',
group: create(:group))
end
before do
project_tree_restorer.instance_variable_set(:@path, "spec/lib/gitlab/import_export/project.light.json")
end
it 'imports labels' do
create(:group_label, name: 'Another label', group: project.group)
expect_any_instance_of(Gitlab::ImportExport::Shared).not_to receive(:error)
restored_project_json
expect(project.labels.count).to eq(1)
end
it 'imports milestones' do
create(:milestone, name: 'A milestone', group: project.group)
expect_any_instance_of(Gitlab::ImportExport::Shared).not_to receive(:error)
restored_project_json
expect(project.milestones.count).to eq(1)
end
end
end end
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