From f0603e4cb7cfc043239554857a1143943b50b22f Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 20 Jul 2016 16:09:43 +0200 Subject: added spec, fixed wording --- app/views/projects/new.html.haml | 6 +++--- spec/features/projects/import_export/import_file_spec.rb | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 5025542f0f9..facdfcc9447 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -136,12 +136,12 @@ }); $('.btn_import_gitlab_project').attr('disabled',true) - $('.import_gitlab_project').attr('title', 'Project path required.'); + $('.import_gitlab_project').attr('title', 'Project path and name required.'); $('.import_gitlab_project').click(function( event ) { if($('.btn_import_gitlab_project').attr('disabled')) { event.preventDefault(); - new Flash("Please enter a path for the project to be imported to."); + new Flash("Please enter path and name for the project to be imported to."); } }); @@ -152,7 +152,7 @@ $(".flash-container").html("") } else { $('.btn_import_gitlab_project').attr('disabled',true); - $('.import_gitlab_project').attr('title', 'Project path required.'); + $('.import_gitlab_project').attr('title', 'Project path and name required.'); } }); diff --git a/spec/features/projects/import_export/import_file_spec.rb b/spec/features/projects/import_export/import_file_spec.rb index bc3bf53fe9d..40809aa4aba 100644 --- a/spec/features/projects/import_export/import_file_spec.rb +++ b/spec/features/projects/import_export/import_file_spec.rb @@ -59,6 +59,19 @@ feature 'project import', feature: true, js: true do end end + scenario 'project with no name' do + project = create(:project, namespace_id: 2) + + visit new_project_path + + select2('2', from: '#project_namespace_id') + click_link 'GitLab export' + + page.within('.flash-container') do + expect(page).to have_content('Please enter path and name') + end + end + def wiki_exists? wiki = ProjectWiki.new(project) File.exist?(wiki.repository.path_to_repo) && !wiki.repository.empty? -- cgit v1.2.1