Commit 77794579 authored by James Lopez's avatar James Lopez

fix merge

parent 9ff19904
...@@ -90,7 +90,7 @@ module Gitlab ...@@ -90,7 +90,7 @@ module Gitlab
else else
relation_hash = relation_item[sub_relation.to_s] relation_hash = relation_item[sub_relation.to_s]
end end
return relation_hash, sub_relation [relation_hash, sub_relation]
end end
def create_relation(relation, relation_hash_list) def create_relation(relation, relation_hash_list)
......
...@@ -57,25 +57,25 @@ describe Gitlab::ImportExport::Reader, lib: true do ...@@ -57,25 +57,25 @@ describe Gitlab::ImportExport::Reader, lib: true do
end end
it 'generates the correct hash for a relation with included attributes' do it 'generates the correct hash for a relation with included attributes' do
setup_yaml(project_tree: [:issues], included_attributes: {issues: [:name, :description]}) setup_yaml(project_tree: [:issues], included_attributes: { issues: [:name, :description] })
expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { only: [:name, :description] } }]) expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { only: [:name, :description] } }])
end end
it 'generates the correct hash for a relation with excluded attributes' do it 'generates the correct hash for a relation with excluded attributes' do
setup_yaml(project_tree: [:issues], excluded_attributes: {issues: [:name]}) setup_yaml(project_tree: [:issues], excluded_attributes: { issues: [:name] })
expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { except: [:name] } }]) expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { except: [:name] } }])
end end
it 'generates the correct hash for a relation with both excluded and included attributes' do it 'generates the correct hash for a relation with both excluded and included attributes' do
setup_yaml(project_tree: [:issues], excluded_attributes: {issues: [:name]}, included_attributes: {issues: [:description]}) setup_yaml(project_tree: [:issues], excluded_attributes: { issues: [:name] }, included_attributes: { issues: [:description] })
expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { except: [:name], only: [:description]} }]) expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { except: [:name], only: [:description] } }])
end end
it 'generates the correct hash for a relation with custom methods' do it 'generates the correct hash for a relation with custom methods' do
setup_yaml(project_tree: [:issues], methods: {issues: [:name]}) setup_yaml(project_tree: [:issues], methods: { issues: [:name] })
expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { methods: [:name] } }]) expect(described_class.new(shared: shared).project_tree).to match(include: [{ issues: { methods: [:name] } }])
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