summaryrefslogtreecommitdiff
path: root/spec/features/auto_deploy_spec.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-12-22 10:15:49 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-22 10:15:49 +0000
commit7fc64dd18d9b2b6e3a2a01dab0007f7dd25c37ed (patch)
tree428602d5265cd981a2e33ace8aed6fc9594dd37c /spec/features/auto_deploy_spec.rb
parentfd3ab00cf90ddf081c61fb701721ca9180378bba (diff)
parent6d9c1d3efce00da95832feaaf36227bcbffecadf (diff)
downloadgitlab-ce-pipeline-ui-updates.tar.gz
Merge branch 'master' into pipeline-ui-updatespipeline-ui-updates
* master: (259 commits) Exclude non existent repository storages. fixed minor animation glitch in mini pipeline graph animation Update Bitbucket callback URL documentation Update build step for KaTeX. Add KaTeX fonts to assets paths and precompile Replace url('...') to url(font-path('...')) Rname katex.css to katex.scss Revert conflicting EE changes Added Autodeploy script for OpenShift Whitelist next project names: notes, services Put back progress bar CSS Remove unneeded bundle refs. Adds entry to changelog Reduce MR widget title by one pixel Use same font size for all items in issue title Adds background color for disabled state to merge when succeeds dropdown Filter protocol-relative URLs in ExternalLinkFilter. Fixes issue #22742. Move javascript for widget check to ci_bundle. Introduce "Set up autodeploy" button to help configure GitLab CI for deployment Whitelist next project names: help, ci, admin, search ...
Diffstat (limited to 'spec/features/auto_deploy_spec.rb')
-rw-r--r--spec/features/auto_deploy_spec.rb64
1 files changed, 64 insertions, 0 deletions
diff --git a/spec/features/auto_deploy_spec.rb b/spec/features/auto_deploy_spec.rb
new file mode 100644
index 00000000000..92f1ab90881
--- /dev/null
+++ b/spec/features/auto_deploy_spec.rb
@@ -0,0 +1,64 @@
+require 'spec_helper'
+
+describe 'Auto deploy' do
+ include WaitForAjax
+
+ let(:user) { create(:user) }
+ let(:project) { create(:project) }
+
+ before do
+ project.create_kubernetes_service(
+ active: true,
+ properties: {
+ namespace: project.path,
+ api_url: 'https://kubernetes.example.com',
+ token: 'a' * 40,
+ }
+ )
+ project.team << [user, :master]
+ login_as user
+ end
+
+ context 'when no deployment service is active' do
+ before do
+ project.kubernetes_service.update!(active: false)
+ end
+
+ it 'does not show a button to set up auto deploy' do
+ visit namespace_project_path(project.namespace, project)
+ expect(page).to have_no_content('Set up autodeploy')
+ end
+ end
+
+ context 'when a deployment service is active' do
+ before do
+ project.kubernetes_service.update!(active: true)
+ visit namespace_project_path(project.namespace, project)
+ end
+
+ it 'shows a button to set up auto deploy' do
+ expect(page).to have_link('Set up autodeploy')
+ end
+
+ it 'includes Kubernetes as an available template', js: true do
+ click_link 'Set up autodeploy'
+ click_button 'Choose a GitLab CI Yaml template'
+
+ within '.gitlab-ci-yml-selector' do
+ expect(page).to have_content('OpenShift')
+ end
+ end
+
+ it 'creates a merge request using "autodeploy" branch', js: true do
+ click_link 'Set up autodeploy'
+ click_button 'Choose a GitLab CI Yaml template'
+ within '.gitlab-ci-yml-selector' do
+ click_on 'OpenShift'
+ end
+ wait_for_ajax
+ click_button 'Commit Changes'
+
+ expect(page).to have_content('New Merge Request From autodeploy into master')
+ end
+ end
+end