summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 18:09:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 18:09:02 +0000
commit951616a26a61e880860ad862c1d45a8e3762b4bc (patch)
treeed6fe722e955aff38e13ca02d2aa7fdd4239c863 /spec/tasks
parente06d0e779673d745972863302858105aad9032e5 (diff)
downloadgitlab-ce-951616a26a61e880860ad862c1d45a8e3762b4bc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/import_export/export_rake_spec.rb37
-rw-r--r--spec/tasks/gitlab/import_export/import_rake_spec.rb2
2 files changed, 38 insertions, 1 deletions
diff --git a/spec/tasks/gitlab/import_export/export_rake_spec.rb b/spec/tasks/gitlab/import_export/export_rake_spec.rb
new file mode 100644
index 00000000000..b665b46fe1c
--- /dev/null
+++ b/spec/tasks/gitlab/import_export/export_rake_spec.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+require 'rake_helper'
+
+describe 'gitlab:import_export:export rake task' do
+ let(:username) { 'root' }
+ let(:namespace_path) { username }
+ let!(:user) { create(:user, username: username) }
+ let(:measurement_enabled) { false }
+ let(:task_params) { [username, namespace_path, project_name, archive_path, measurement_enabled] }
+
+ before do
+ Rake.application.rake_require('tasks/gitlab/import_export/export')
+ end
+
+ subject { run_rake_task('gitlab:import_export:export', task_params) }
+
+ context 'when project is found' do
+ let(:project) { create(:project, creator: user, namespace: user.namespace) }
+ let(:project_name) { project.name }
+ let(:archive_path) { 'spec/fixtures/gitlab/import_export/test_project_export.tar.gz' }
+
+ around do |example|
+ example.run
+ ensure
+ File.delete(archive_path)
+ end
+
+ it 'performs project export successfully' do
+ expect { subject }.to output(/Done!/).to_stdout
+
+ expect(File).to exist(archive_path)
+ end
+
+ it_behaves_like 'measurable'
+ end
+end
diff --git a/spec/tasks/gitlab/import_export/import_rake_spec.rb b/spec/tasks/gitlab/import_export/import_rake_spec.rb
index 3a819d23299..3e0bf2d0832 100644
--- a/spec/tasks/gitlab/import_export/import_rake_spec.rb
+++ b/spec/tasks/gitlab/import_export/import_rake_spec.rb
@@ -70,7 +70,7 @@ describe 'gitlab:import_export:import rake task' do
subject
end
- it_behaves_like 'import measurement'
+ it_behaves_like 'measurable'
end
context 'when project import is invalid' do