Commit 1885a301 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tests in import_sources_spec.rb

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c1af6e4b
...@@ -20,7 +20,7 @@ class Import::ManifestController < Import::BaseController ...@@ -20,7 +20,7 @@ class Import::ManifestController < Import::BaseController
unless can?(current_user, :create_projects, group) unless can?(current_user, :create_projects, group)
@errors = ["You don't have enough permissions to create projects in the selected group"] @errors = ["You don't have enough permissions to create projects in the selected group"]
render :new and return render :new && return
end end
manifest = Gitlab::ManifestImport::Manifest.new(params[:manifest].tempfile) manifest = Gitlab::ManifestImport::Manifest.new(params[:manifest].tempfile)
......
...@@ -17,7 +17,7 @@ module Gitlab ...@@ -17,7 +17,7 @@ module Gitlab
ImportSource.new('git', 'Repo by URL', nil), ImportSource.new('git', 'Repo by URL', nil),
ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer), ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer),
ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer), ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer),
ImportSource.new('manifest', 'Manifest', Gitlab::ManifestImport::Importer) ImportSource.new('manifest', 'Manifest file', Gitlab::ManifestImport::Importer)
].freeze ].freeze
class << self class << self
......
...@@ -12,7 +12,8 @@ describe Gitlab::ImportSources do ...@@ -12,7 +12,8 @@ describe Gitlab::ImportSources do
'FogBugz' => 'fogbugz', 'FogBugz' => 'fogbugz',
'Repo by URL' => 'git', 'Repo by URL' => 'git',
'GitLab export' => 'gitlab_project', 'GitLab export' => 'gitlab_project',
'Gitea' => 'gitea' 'Gitea' => 'gitea',
'Manifest file' => 'manifest'
} }
expect(described_class.options).to eq(expected) expect(described_class.options).to eq(expected)
...@@ -31,6 +32,7 @@ describe Gitlab::ImportSources do ...@@ -31,6 +32,7 @@ describe Gitlab::ImportSources do
git git
gitlab_project gitlab_project
gitea gitea
manifest
) )
expect(described_class.values).to eq(expected) expect(described_class.values).to eq(expected)
...@@ -48,6 +50,7 @@ describe Gitlab::ImportSources do ...@@ -48,6 +50,7 @@ describe Gitlab::ImportSources do
fogbugz fogbugz
gitlab_project gitlab_project
gitea gitea
manifest
) )
expect(described_class.importer_names).to eq(expected) expect(described_class.importer_names).to eq(expected)
...@@ -63,7 +66,8 @@ describe Gitlab::ImportSources do ...@@ -63,7 +66,8 @@ describe Gitlab::ImportSources do
'fogbugz' => Gitlab::FogbugzImport::Importer, 'fogbugz' => Gitlab::FogbugzImport::Importer,
'git' => nil, 'git' => nil,
'gitlab_project' => Gitlab::ImportExport::Importer, 'gitlab_project' => Gitlab::ImportExport::Importer,
'gitea' => Gitlab::LegacyGithubImport::Importer 'gitea' => Gitlab::LegacyGithubImport::Importer,
'manifest' => Gitlab::ManifestImport::Importer
} }
import_sources.each do |name, klass| import_sources.each do |name, klass|
...@@ -82,7 +86,8 @@ describe Gitlab::ImportSources do ...@@ -82,7 +86,8 @@ describe Gitlab::ImportSources do
'fogbugz' => 'FogBugz', 'fogbugz' => 'FogBugz',
'git' => 'Repo by URL', 'git' => 'Repo by URL',
'gitlab_project' => 'GitLab export', 'gitlab_project' => 'GitLab export',
'gitea' => 'Gitea' 'gitea' => 'Gitea',
'manifest' => 'Manifest file'
} }
import_sources.each do |name, title| import_sources.each do |name, title|
......
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