Commit 4cee5d2e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Move manifest import to separate page and add feature specs

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0f9dacf4
......@@ -18,5 +18,5 @@
= _('Choose the top-level group for your repository imports.')
.append-bottom-10
= submit_tag 'Import projects', class: 'btn btn-success'
= submit_tag 'Continue to the next step', class: 'btn btn-success'
= link_to 'Cancel', new_project_path, class: 'btn btn-cancel'
......@@ -5,9 +5,6 @@
%h3.page-title
= _('Manifest file import')
%p.light
= _('Import multiple repositories by uploading a manifest file.')
%p
= button_tag class: "btn btn-import btn-success js-import-all" do
= import_all_githubish_repositories_button_label
......
......@@ -44,7 +44,7 @@
= icon('git', text: 'Repo by URL')
%div
- if manifest_import_enabled?
%button.btn{ type: "button" }
= link_to new_import_manifest_path, class: 'btn import_manifest' do
= icon('file-text-o', text: 'Manifest file')
.js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') }
......@@ -52,7 +52,3 @@
%hr
= render "shared/import_form", f: f
= render 'new_project_fields', f: f, project_name_id: "import-url-name"
.toggle-manifest-form
%hr
= render 'import/manifest/form'
require 'spec_helper'
feature 'Import multiple repositories by uploading a manifest file' do
include Select2Helper
let(:user) { create(:admin) }
let(:group) { create(:group) }
before do
sign_in(user)
group.add_owner(user)
end
it 'parses manifest file and list repositories', :js do
visit new_import_manifest_path
attach_file('manifest', Rails.root.join('spec/fixtures/aosp_manifest.xml'))
click_on 'Continue to the next step'
expect(page).to have_button('Import all repositories')
expect(page).to have_content('https://android-review.googlesource.com/platform/build/blueprint')
end
end
......@@ -23,6 +23,7 @@ describe 'New project' do
expect(page).to have_link('Google Code')
expect(page).to have_button('Repo by URL')
expect(page).to have_link('GitLab export')
expect(page).to have_link('Manifest file')
end
context 'Visibility level selector', :js do
......@@ -201,5 +202,16 @@ describe 'New project' do
expect(current_path).to eq new_import_google_code_path
end
end
context 'from manifest file' do
before do
first('.import_manifest').click
end
it 'shows import instructions' do
expect(page).to have_content('Manifest file import')
expect(current_path).to eq new_import_manifest_path
end
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