summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-06-16 18:53:41 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-06-20 14:48:28 -0500
commita18df1d15af68be4d129412ad2a6145277ca43d3 (patch)
treec115aeaff9f95b261b7d90ca7774b6845261ad9a
parent483dc62eaac0e11717b5b103317c4441ec0ff23d (diff)
downloadgitlab-ce-a18df1d15af68be4d129412ad2a6145277ca43d3.tar.gz
Add feature test for gitab CI dropdown
-rw-r--r--spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb
new file mode 100644
index 00000000000..d516e8ce55a
--- /dev/null
+++ b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+feature 'User wants to add a .gitlab-ci.yml file', feature: true do
+ include WaitForAjax
+
+ before do
+ user = create(:user)
+ project = create(:project)
+ project.team << [user, :master]
+ login_as user
+ visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: '.gitlab-ci.yml')
+ end
+
+ scenario 'user can see .gitlab-ci.yml dropdown' do
+ expect(page).to have_css('.gitlab-ci-yml-selector')
+ end
+
+ scenario 'user can pick a template from the dropdown', js: true do
+ find('.js-gitlab-ci-yml-selector').click
+ wait_for_ajax
+ within '.gitlab-ci-yml-selector' do
+ find('.dropdown-input-field').set('jekyll')
+ find('.dropdown-content li', text: 'jekyll').click
+ end
+ wait_for_ajax
+
+ expect(page).to have_content('This file is a template, and might need editing before it works on your project')
+ expect(page).to have_content('jekyll build -d test')
+ end
+end