diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2016-12-21 21:34:45 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2016-12-21 21:34:45 +0000 |
commit | 68d89aa96b1ae7ea742cc5ac708bd8d08492826b (patch) | |
tree | ad3394558392e189cb406ddea227429240d6e88f /spec | |
parent | bdc4a9f290ae9624f7a1822e42e7fbf5288ca132 (diff) | |
parent | 4a1e1281ac862a0c86d62473ab09d559c7ec5485 (diff) | |
download | gitlab-ce-68d89aa96b1ae7ea742cc5ac708bd8d08492826b.tar.gz |
Merge branch 'adam-auto-deploy' into 'master'
Auto deploy
Closes #23580
See merge request !8135
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/auto_deploy_spec.rb | 64 |
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 |