Commit 46514315 authored by Mayra Cabrera's avatar Mayra Cabrera Committed by Robert Speicher

Add 'nested_groups' to nested group Epic specs

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/11513
parent 51593300
...@@ -118,7 +118,7 @@ describe Epic do ...@@ -118,7 +118,7 @@ describe Epic do
expect(epic.valid_parent?).to be_falsey expect(epic.valid_parent?).to be_falsey
end end
it 'returns false when level is too deep' do it 'returns false when level is too deep', :nested_groups do
epic1 = create(:epic, group: group) epic1 = create(:epic, group: group)
epic2 = create(:epic, group: group, parent: epic1) epic2 = create(:epic, group: group, parent: epic1)
epic3 = create(:epic, group: group, parent: epic2) epic3 = create(:epic, group: group, parent: epic2)
...@@ -142,7 +142,7 @@ describe Epic do ...@@ -142,7 +142,7 @@ describe Epic do
expect(epic.valid_parent?).to be_truthy expect(epic.valid_parent?).to be_truthy
end end
it 'returns false when total depth after adding would exceed limit' do it 'returns false when total depth after adding would exceed limit', :nested_groups do
child_epic2 = create(:epic, group: group, parent: child_epic1) child_epic2 = create(:epic, group: group, parent: child_epic1)
child_epic3 = create(:epic, group: group, parent: child_epic2) child_epic3 = create(:epic, group: group, parent: child_epic2)
child_epic4 = create(:epic, group: group, parent: child_epic3) child_epic4 = create(:epic, group: group, parent: child_epic3)
...@@ -166,7 +166,7 @@ describe Epic do ...@@ -166,7 +166,7 @@ describe Epic do
expect(epic.valid_parent?).to be_truthy expect(epic.valid_parent?).to be_truthy
end end
it 'returns false when total depth after adding would exceed limit' do it 'returns false when total depth after adding would exceed limit', :nested_groups do
root_epic.update(parent: create(:epic, group: group)) root_epic.update(parent: create(:epic, group: group))
create(:epic, group: group, parent: child_epic1) create(:epic, group: group, parent: child_epic1)
...@@ -185,14 +185,14 @@ describe Epic do ...@@ -185,14 +185,14 @@ describe Epic do
expect(epic.valid_parent?).to be_falsey expect(epic.valid_parent?).to be_falsey
end end
it 'returns false when child epic is parent of the given parent' do it 'returns false when child epic is parent of the given parent', :nested_groups do
epic1 = create(:epic, group: group, parent: epic) epic1 = create(:epic, group: group, parent: epic)
epic.parent = epic1 epic.parent = epic1
expect(epic.valid_parent?).to be_falsey expect(epic.valid_parent?).to be_falsey
end end
it 'returns false when child epic is an ancestor of the given parent' do it 'returns false when child epic is an ancestor of the given parent', :nested_groups do
epic1 = create(:epic, group: group, parent: epic) epic1 = create(:epic, group: group, parent: epic)
epic2 = create(:epic, group: group, parent: epic1) epic2 = create(:epic, group: group, parent: epic1)
epic.parent = epic2 epic.parent = epic2
......
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