summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-11-29 00:10:37 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-11-29 00:10:37 +0000
commit4ab1a1bd1767b6ea408a20dd1af7a0d29af82bfd (patch)
treeca96c48afdd33e9825bdeafc016d989112ec6066
parente2babfbde1dc65761e045ffa9d37586cbefa02f7 (diff)
parent4fae2574c41f0e2248989b9dac8738d546ea0217 (diff)
downloadgitlab-ce-4ab1a1bd1767b6ea408a20dd1af7a0d29af82bfd.tar.gz
Merge branch 'fix_invalid_new_pipeline_form' into 'master'
initializes the branches dropdown upon invalid entry Closes #40012 See merge request gitlab-org/gitlab-ce!15588
-rw-r--r--app/assets/javascripts/dispatcher.js1
-rw-r--r--changelogs/unreleased/15588-fix-empty-dropdown-on-create-new-pipeline-in-case-of-validation-errors.yml5
-rw-r--r--spec/features/projects/pipelines/pipelines_spec.rb12
3 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 9e84e441ae8..a21c92f24d6 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -383,6 +383,7 @@ import ProjectVariables from './project_variables';
projectImport();
break;
case 'projects:pipelines:new':
+ case 'projects:pipelines:create':
new NewBranchForm($('.js-new-pipeline-form'));
break;
case 'projects:pipelines:builds':
diff --git a/changelogs/unreleased/15588-fix-empty-dropdown-on-create-new-pipeline-in-case-of-validation-errors.yml b/changelogs/unreleased/15588-fix-empty-dropdown-on-create-new-pipeline-in-case-of-validation-errors.yml
new file mode 100644
index 00000000000..a4934c8896d
--- /dev/null
+++ b/changelogs/unreleased/15588-fix-empty-dropdown-on-create-new-pipeline-in-case-of-validation-errors.yml
@@ -0,0 +1,5 @@
+---
+title: Initializes the branches dropdown when the 'Start new pipeline' failed due to validation errors
+merge_request: 15588
+author: Christiaan Van den Poel
+type: fixed
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb
index 50f8f13d261..a1b1d94ae06 100644
--- a/spec/features/projects/pipelines/pipelines_spec.rb
+++ b/spec/features/projects/pipelines/pipelines_spec.rb
@@ -500,6 +500,18 @@ describe 'Pipelines', :js do
end
it { expect(page).to have_content('Missing .gitlab-ci.yml file') }
+ it 'creates a pipeline after first request failed and a valid gitlab-ci.yml file is available when trying again' do
+ click_button project.default_branch
+
+ stub_ci_pipeline_to_return_yaml_file
+
+ page.within '.dropdown-menu' do
+ click_link 'master'
+ end
+
+ expect { click_on 'Create pipeline' }
+ .to change { Ci::Pipeline.count }.by(1)
+ end
end
end
end