summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-05 12:54:46 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-11 12:22:57 +0300
commit1885a3014cf84e460693a2ff97562328b152d26f (patch)
tree72db3fa8d66581119643bf024f6b59655a9b73fd
parentc1af6e4b13a283fa908fa2244c33fd5abd8bb83c (diff)
downloadgitlab-ce-1885a3014cf84e460693a2ff97562328b152d26f.tar.gz
Fix tests in import_sources_spec.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/controllers/import/manifest_controller.rb2
-rw-r--r--lib/gitlab/import_sources.rb2
-rw-r--r--spec/lib/gitlab/import_sources_spec.rb11
3 files changed, 10 insertions, 5 deletions
diff --git a/app/controllers/import/manifest_controller.rb b/app/controllers/import/manifest_controller.rb
index 2daf57986f3..639431690bb 100644
--- a/app/controllers/import/manifest_controller.rb
+++ b/app/controllers/import/manifest_controller.rb
@@ -20,7 +20,7 @@ class Import::ManifestController < Import::BaseController
unless can?(current_user, :create_projects, group)
@errors = ["You don't have enough permissions to create projects in the selected group"]
- render :new and return
+ render :new && return
end
manifest = Gitlab::ManifestImport::Manifest.new(params[:manifest].tempfile)
diff --git a/lib/gitlab/import_sources.rb b/lib/gitlab/import_sources.rb
index a13ee371e99..374420b9061 100644
--- a/lib/gitlab/import_sources.rb
+++ b/lib/gitlab/import_sources.rb
@@ -17,7 +17,7 @@ module Gitlab
ImportSource.new('git', 'Repo by URL', nil),
ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer),
ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer),
- ImportSource.new('manifest', 'Manifest', Gitlab::ManifestImport::Importer)
+ ImportSource.new('manifest', 'Manifest file', Gitlab::ManifestImport::Importer)
].freeze
class << self
diff --git a/spec/lib/gitlab/import_sources_spec.rb b/spec/lib/gitlab/import_sources_spec.rb
index 10341486512..7734f48de86 100644
--- a/spec/lib/gitlab/import_sources_spec.rb
+++ b/spec/lib/gitlab/import_sources_spec.rb
@@ -12,7 +12,8 @@ describe Gitlab::ImportSources do
'FogBugz' => 'fogbugz',
'Repo by URL' => 'git',
'GitLab export' => 'gitlab_project',
- 'Gitea' => 'gitea'
+ 'Gitea' => 'gitea',
+ 'Manifest file' => 'manifest'
}
expect(described_class.options).to eq(expected)
@@ -31,6 +32,7 @@ describe Gitlab::ImportSources do
git
gitlab_project
gitea
+ manifest
)
expect(described_class.values).to eq(expected)
@@ -48,6 +50,7 @@ describe Gitlab::ImportSources do
fogbugz
gitlab_project
gitea
+ manifest
)
expect(described_class.importer_names).to eq(expected)
@@ -63,7 +66,8 @@ describe Gitlab::ImportSources do
'fogbugz' => Gitlab::FogbugzImport::Importer,
'git' => nil,
'gitlab_project' => Gitlab::ImportExport::Importer,
- 'gitea' => Gitlab::LegacyGithubImport::Importer
+ 'gitea' => Gitlab::LegacyGithubImport::Importer,
+ 'manifest' => Gitlab::ManifestImport::Importer
}
import_sources.each do |name, klass|
@@ -82,7 +86,8 @@ describe Gitlab::ImportSources do
'fogbugz' => 'FogBugz',
'git' => 'Repo by URL',
'gitlab_project' => 'GitLab export',
- 'gitea' => 'Gitea'
+ 'gitea' => 'Gitea',
+ 'manifest' => 'Manifest file'
}
import_sources.each do |name, title|