From 1885a3014cf84e460693a2ff97562328b152d26f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Jul 2018 12:54:46 +0300 Subject: Fix tests in import_sources_spec.rb Signed-off-by: Dmitriy Zaporozhets --- app/controllers/import/manifest_controller.rb | 2 +- lib/gitlab/import_sources.rb | 2 +- spec/lib/gitlab/import_sources_spec.rb | 11 ++++++++--- 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| -- cgit v1.2.1