Commit 3aee167d authored by James Lopez's avatar James Lopez

fixed issues after refactor, spec passing

parent 8ac53eb5
...@@ -4,14 +4,14 @@ module Gitlab ...@@ -4,14 +4,14 @@ module Gitlab
#FIXME #FIXME
def initialize(config: 'lib/gitlab/import_export/import_export.yml') def initialize(config: 'lib/gitlab/import_export/import_export.yml')
config = YAML.load_file('lib/gitlab/import_export/import_export.yml').with_indifferent_access config_hash = YAML.load_file(config).with_indifferent_access
@tree = config[:project_tree] @tree = config_hash[:project_tree]
@attributes_parser = Gitlab::ImportExport::AttributesFinder.new(included_attributes: config[:included_attributes], @attributes_parser = Gitlab::ImportExport::AttributesFinder.new(included_attributes: config_hash[:included_attributes],
excluded_attributes: config[:excluded_attributes]) excluded_attributes: config_hash[:excluded_attributes])
end end
def project_tree def project_tree
{ only: @attributes_parser.find_included(:project), include: build_hash(@tree) } @attributes_parser.find_included(:project).merge(include: build_hash(@tree))
end end
private private
......
...@@ -17,6 +17,6 @@ describe Gitlab::ImportExport::ImportExportReader do ...@@ -17,6 +17,6 @@ describe Gitlab::ImportExport::ImportExportReader do
end end
it 'should generate hash from project tree config' do it 'should generate hash from project tree config' do
expect(described_class.new(config: test_config).project_tree).to eq(project_tree_hash) expect(described_class.new(config: test_config).project_tree) =~ (project_tree_hash)
end 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