Commit 38b2d37e authored by Kassio Borges's avatar Kassio Borges

Prepare `...Group::Treesaver` to ndjson

Renaming `Gitlab::ImportExport::Group::Treesaver` to
`Gitlab::ImportExport::Group::LegacyTreesaver` is part of the effort
to enable `ndjson` on the Group Import/Export feature.
With `ndjson` enabled all the structure of saving a group-tree is
different, so to make the maintenance easier the "non-ndjson"
structure is being renamed.
parent bff085a5
......@@ -56,7 +56,12 @@ module Groups
end
def tree_exporter
Gitlab::ImportExport::Group::TreeSaver.new(group: @group, current_user: @current_user, shared: @shared, params: @params)
Gitlab::ImportExport::Group::LegacyTreeSaver.new(
group: @group,
current_user: @current_user,
shared: @shared,
params: @params
)
end
def file_saver
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Group::TreeSaver do
describe Gitlab::ImportExport::Group::LegacyTreeSaver do
describe 'saves the group tree into a json object' do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
......
......@@ -3,7 +3,7 @@
module Gitlab
module ImportExport
module Group
class TreeSaver
class LegacyTreeSaver
attr_reader :full_path, :shared
def initialize(group:, current_user:, shared:, params: {})
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::ImportExport::Group::TreeSaver do
describe Gitlab::ImportExport::Group::LegacyTreeSaver do
describe 'saves the group tree into a json object' do
let(:shared) { Gitlab::ImportExport::Shared.new(group) }
let(:group_tree_saver) { described_class.new(group: group, current_user: user, shared: shared) }
......@@ -28,7 +28,7 @@ describe Gitlab::ImportExport::Group::TreeSaver do
# except:
# context 'with description override' do
# context 'group members' do
# ^ These are specific for the Group::TreeSaver
# ^ These are specific for the Group::LegacyTreeSaver
context 'JSON' do
let(:saved_group_json) do
group_tree_saver.save
......
......@@ -50,7 +50,7 @@ describe Groups::ImportExport::ExportService do
end
it 'saves the models' do
expect(Gitlab::ImportExport::Group::TreeSaver).to receive(:new).and_call_original
expect(Gitlab::ImportExport::Group::LegacyTreeSaver).to receive(:new).and_call_original
service.execute
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