diff options
-rw-r--r-- | app/views/import/manifest/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/import/manifest/status.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/_import_project_pane.html.haml | 6 | ||||
-rw-r--r-- | spec/features/import/manifest_import_spec.rb | 24 | ||||
-rw-r--r-- | spec/features/projects/new_project_spec.rb | 12 |
5 files changed, 38 insertions, 9 deletions
diff --git a/app/views/import/manifest/_form.html.haml b/app/views/import/manifest/_form.html.haml index 6261a2b6864..8ace2b7bff1 100644 --- a/app/views/import/manifest/_form.html.haml +++ b/app/views/import/manifest/_form.html.haml @@ -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' diff --git a/app/views/import/manifest/status.html.haml b/app/views/import/manifest/status.html.haml index 39aba9234d3..653dc249182 100644 --- a/app/views/import/manifest/status.html.haml +++ b/app/views/import/manifest/status.html.haml @@ -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 diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 7f4520fa50f..cfbaebec876 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -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' diff --git a/spec/features/import/manifest_import_spec.rb b/spec/features/import/manifest_import_spec.rb new file mode 100644 index 00000000000..8f5416c4c27 --- /dev/null +++ b/spec/features/import/manifest_import_spec.rb @@ -0,0 +1,24 @@ +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 diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index f23ec11a458..1bbbfec2a4f 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -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 |