add spec replicating both label and milestone duplicated title issues
This commit is contained in:
parent
a170c587a0
commit
f5e4adc9bf
2 changed files with 38 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
|||
"milestones": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "Project milestone",
|
||||
"title": "A milestone",
|
||||
"project_id": 8,
|
||||
"description": "Project-level milestone",
|
||||
"due_date": null,
|
||||
|
@ -66,7 +66,7 @@
|
|||
"group_milestone_id": null,
|
||||
"milestone": {
|
||||
"id": 1,
|
||||
"title": "Project milestone",
|
||||
"title": "A milestone",
|
||||
"project_id": 8,
|
||||
"description": "Project-level milestone",
|
||||
"due_date": null,
|
||||
|
@ -86,7 +86,7 @@
|
|||
"updated_at": "2017-08-15T18:37:40.795Z",
|
||||
"label": {
|
||||
"id": 6,
|
||||
"title": "Another project label",
|
||||
"title": "Another label",
|
||||
"color": "#A8D695",
|
||||
"project_id": null,
|
||||
"created_at": "2017-08-15T18:37:19.698Z",
|
||||
|
|
|
@ -189,8 +189,8 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
|
|||
|
||||
@project.pipelines.zip([2, 2, 2, 2, 2])
|
||||
.each do |(pipeline, expected_status_size)|
|
||||
expect(pipeline.statuses.size).to eq(expected_status_size)
|
||||
end
|
||||
expect(pipeline.statuses.size).to eq(expected_status_size)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -368,5 +368,38 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
|
|||
milestones: 1,
|
||||
first_issue_labels: 1
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue