Commit e7dae6cf authored by Albert Salim's avatar Albert Salim

Extract `epic_json` into a `let`

parent 9877a42a
......@@ -33,6 +33,12 @@ describe Gitlab::ImportExport::GroupTreeSaver do
end
context 'epics relation' do
let(:epic_json) do
saved_group_json['epics'].find do |attrs|
attrs['id'] == epic.id
end
end
it 'saves top level epics' do
expect_successful_save(group_tree_saver)
expect(saved_group_json['epics'].size).to eq(2)
......@@ -41,11 +47,7 @@ describe Gitlab::ImportExport::GroupTreeSaver do
it 'saves parent of epic' do
expect_successful_save(group_tree_saver)
child = saved_group_json['epics'].find do |attrs|
attrs['id'] == epic.id
end
parent = child['parent']
parent = epic_json['parent']
expect(parent).not_to be_empty
expect(parent['id']).to eq(parent_epic.id)
......@@ -54,11 +56,7 @@ describe Gitlab::ImportExport::GroupTreeSaver do
it 'saves epic notes' do
expect_successful_save(group_tree_saver)
child = saved_group_json['epics'].find do |attrs|
attrs['id'] == epic.id
end
notes = child['notes']
notes = epic_json['notes']
expect(notes).not_to be_empty
expect(notes.first['note']).to eq(note.note)
......
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