Commit fe56d29d authored by James Lopez's avatar James Lopez

update spec

parent b99bc6d3
......@@ -10,12 +10,61 @@ describe Gitlab::ImportExport::GroupProjectFinder do
group: create(:group))
end
context 'labels' do
it 'finds the right group label' do
group_label = create(:group_label, 'name': 'group label', 'group': project.group)
expect(described_class.find(Label,
expect(described_class.find_or_new(Label,
title: 'group label',
'project_id': project.id,
'group_id': project.group.id)).to eq([group_label])
'project_id' => project.id,
'group_id' => project.group.id)).to eq(group_label)
end
it 'initializes a new label' do
label = described_class.find_or_new(Label,
title: 'group label',
'project_id' => project.id,
'group_id' => project.group.id)
expect(label.persisted?).to be false
end
it 'creates a new label' do
label = described_class.find_or_create(Label,
title: 'group label',
'project_id' => project.id,
'group_id' => project.group.id)
expect(label.persisted?).to be true
end
end
context 'milestones' do
it 'finds the right group milestone' do
milestone = create(:milestone, 'name' => 'group milestone', 'group' => project.group)
expect(described_class.find_or_new(Milestone,
title: 'group milestone',
'project_id' => project.id,
'group_id' => project.group.id)).to eq(milestone)
end
it 'initializes a new milestone' do
milestone = described_class.find_or_new(Milestone,
title: 'group milestone',
'project_id' => project.id,
'group_id' => project.group.id)
expect(milestone.persisted?).to be false
end
it 'creates a new milestone' do
milestone = described_class.find_or_create(Milestone,
title: 'group milestone',
'project_id' => project.id,
'group_id' => project.group.id)
expect(milestone.persisted?).to be true
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