diff options
author | Rémy Coutable <remy@rymai.me> | 2018-05-22 15:38:31 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-24 20:29:29 +0300 |
commit | 248cefc7091224d62d4559b9a49813a27b793a0e (patch) | |
tree | 8070250520caeca100aa15339fce581819679469 /spec/controllers | |
parent | 2023ac4c28c7355e58e97c0192e8dceffb32efb7 (diff) |
Reduce CE/EE diff in spec/controllers/projects/branches_controller_spec.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/branches_controller_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb index 16fb377b002..4860ea5dcce 100644 --- a/spec/controllers/projects/branches_controller_spec.rb +++ b/spec/controllers/projects/branches_controller_spec.rb @@ -146,6 +146,24 @@ describe Projects::BranchesController do it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes' end + + it 'redirects to autodeploy setup page' do + result = { status: :success, branch: double(name: branch) } + + create(:cluster, :provided_by_gcp, projects: [project]) + + expect_any_instance_of(CreateBranchService).to receive(:execute).and_return(result) + expect(SystemNoteService).to receive(:new_issue_branch).and_return(true) + + post :create, + namespace_id: project.namespace.to_param, + project_id: project.to_param, + branch_name: branch, + issue_iid: issue.iid + + expect(response.location).to include(project_new_blob_path(project, branch)) + expect(response).to have_gitlab_http_status(302) + end end context 'when create branch service fails' do |