Commit 35ab27c2 authored by Luke Duncalfe's avatar Luke Duncalfe

Move import_export test fixtures to spec/fixtures

parent 8432ed98
...@@ -14,7 +14,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -14,7 +14,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
RSpec::Mocks.with_temporary_scope do RSpec::Mocks.with_temporary_scope do
@project = create(:project, :builds_enabled, :issues_disabled, name: 'project', path: 'project') @project = create(:project, :builds_enabled, :issues_disabled, name: 'project', path: 'project')
@shared = @project.import_export_shared @shared = @project.import_export_shared
allow(@shared).to receive(:export_path).and_return('spec/lib/gitlab/import_export/') allow(@shared).to receive(:export_path).and_return('spec/fixtures/lib/gitlab/import_export/')
allow_any_instance_of(Repository).to receive(:fetch_source_branch!).and_return(true) allow_any_instance_of(Repository).to receive(:fetch_source_branch!).and_return(true)
allow_any_instance_of(Gitlab::Git::Repository).to receive(:branch_exists?).and_return(false) allow_any_instance_of(Gitlab::Git::Repository).to receive(:branch_exists?).and_return(false)
...@@ -328,12 +328,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -328,12 +328,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
let(:restored_project_json) { project_tree_restorer.restore } let(:restored_project_json) { project_tree_restorer.restore }
before do before do
allow(shared).to receive(:export_path).and_return('spec/lib/gitlab/import_export/') allow(shared).to receive(:export_path).and_return('spec/fixtures/lib/gitlab/import_export/')
end end
context 'with a simple project' do context 'with a simple project' do
before do before do
project_tree_restorer.instance_variable_set(:@path, "spec/lib/gitlab/import_export/project.light.json") project_tree_restorer.instance_variable_set(:@path, "spec/fixtures/lib/gitlab/import_export/project.light.json")
restored_project_json restored_project_json
end end
...@@ -430,7 +430,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -430,7 +430,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end end
before do before do
project_tree_restorer.instance_variable_set(:@path, "spec/lib/gitlab/import_export/project.group.json") project_tree_restorer.instance_variable_set(:@path, "spec/fixtures/lib/gitlab/import_export/project.group.json")
restored_project_json restored_project_json
end end
...@@ -459,7 +459,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -459,7 +459,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end end
before do before do
project_tree_restorer.instance_variable_set(:@path, "spec/lib/gitlab/import_export/project.light.json") project_tree_restorer.instance_variable_set(:@path, "spec/fixtures/lib/gitlab/import_export/project.light.json")
end end
it 'does not import any templated services' do it 'does not import any templated services' do
...@@ -501,7 +501,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do ...@@ -501,7 +501,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end end
it 'preserves the project milestone IID' do it 'preserves the project milestone IID' do
project_tree_restorer.instance_variable_set(:@path, "spec/lib/gitlab/import_export/project.milestone-iid.json") project_tree_restorer.instance_variable_set(:@path, "spec/fixtures/lib/gitlab/import_export/project.milestone-iid.json")
expect_any_instance_of(Gitlab::ImportExport::Shared).not_to receive(:error) expect_any_instance_of(Gitlab::ImportExport::Shared).not_to receive(:error)
......
...@@ -21,7 +21,7 @@ describe Gitlab::ImportExport::RelationRenameService do ...@@ -21,7 +21,7 @@ describe Gitlab::ImportExport::RelationRenameService do
context 'when importing' do context 'when importing' do
let(:project_tree_restorer) { Gitlab::ImportExport::ProjectTreeRestorer.new(user: user, shared: shared, project: project) } let(:project_tree_restorer) { Gitlab::ImportExport::ProjectTreeRestorer.new(user: user, shared: shared, project: project) }
let(:import_path) { 'spec/lib/gitlab/import_export' } let(:import_path) { 'spec/fixtures/lib/gitlab/import_export' }
let(:file_content) { IO.read("#{import_path}/project.json") } let(:file_content) { IO.read("#{import_path}/project.json") }
let!(:json_file) { ActiveSupport::JSON.decode(file_content) } let!(:json_file) { ActiveSupport::JSON.decode(file_content) }
......
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