summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2017-02-07 17:59:38 +0200
committerValery Sizov <valery@gitlab.com>2017-02-23 15:31:03 +0200
commitd52ef5efd03423006717018d3c3b9d6ff11a378b (patch)
treea0c4fb9771ba3d52a5712e8b2cd2000f26108c30 /spec
parentef27b4beb35745c162df5a4ff8f83ec6ccc91df0 (diff)
downloadgitlab-ce-d52ef5efd03423006717018d3c3b9d6ff11a378b.tar.gz
Fixes after reviewcreate_branch_repo_less
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/branches_controller_spec.rb10
-rw-r--r--spec/factories/services.rb10
2 files changed, 12 insertions, 8 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb
index 3ab3a0eb3e8..effd8bcd982 100644
--- a/spec/controllers/projects/branches_controller_spec.rb
+++ b/spec/controllers/projects/branches_controller_spec.rb
@@ -116,14 +116,7 @@ describe Projects::BranchesController do
it 'redirects to autodeploy setup page' do
result = { status: :success, branch: double(name: branch) }
- project.create_kubernetes_service(
- active: true,
- properties: {
- namespace: project.path,
- api_url: 'https://kubernetes.example.com',
- token: 'a' * 40,
- }
- )
+ project.services << build(:kubernetes_service)
expect_any_instance_of(CreateBranchService).to receive(:execute).and_return(result)
expect(SystemNoteService).to receive(:new_issue_branch).and_return(true)
@@ -135,6 +128,7 @@ describe Projects::BranchesController do
issue_iid: issue.iid
expect(response.location).to include(namespace_project_new_blob_path(project.namespace, project, branch))
+ expect(response).to have_http_status(302)
end
end
diff --git a/spec/factories/services.rb b/spec/factories/services.rb
index a14a46c803e..51335bdcf1d 100644
--- a/spec/factories/services.rb
+++ b/spec/factories/services.rb
@@ -2,4 +2,14 @@ FactoryGirl.define do
factory :service do
project factory: :empty_project
end
+
+ factory :kubernetes_service do
+ project factory: :empty_project
+ active true
+ properties({
+ namespace: 'somepath',
+ api_url: 'https://kubernetes.example.com',
+ token: 'a' * 40,
+ })
+ end
end