Commit c7f15cdb authored by Imre Farkas's avatar Imre Farkas

Merge branch '24804-import-page-namespace-fix' into 'master'

Remove the duplicate hidden namespace_id field on the import page

Closes #24804

See merge request gitlab-org/gitlab!20405
parents f6091b84 04aac095
......@@ -14,7 +14,6 @@
= _("To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here.")
.row
.form-group.col-sm-12
= hidden_field_tag :namespace_id, @namespace.id
= label_tag :file, _('GitLab project export'), class: 'label-bold'
.form-group
= file_field_tag :file, class: ''
......
---
title: Fixed project import from export ignoring namespace selection
merge_request: 20405
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe 'import/gitlab_projects/new.html.haml' do
include Devise::Test::ControllerHelpers
let(:user) { build_stubbed(:user, namespace: build_stubbed(:namespace)) }
before do
allow(view).to receive(:current_user).and_return(user)
end
context 'when the user has no other namespaces' do
it 'shows a namespace_id hidden field tag' do
render
expect(rendered).to have_css('input[name="namespace_id"]', count: 1, visible: false)
end
end
context 'when the user can select other namespaces' do
it 'shows a namespace_id select' do
allow(user).to receive(:can_select_namespace?).and_return(true)
render
expect(rendered).to have_select('namespace_id', count: 1)
end
end
end
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