summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Fargher <proglottis@gmail.com>2019-02-07 16:00:32 +1300
committerJames Fargher <proglottis@gmail.com>2019-02-08 16:38:13 +1300
commit470a86670fed96899a342f0b53a047799921055d (patch)
tree93cb01790ee039bdce376c438881276e2db5a5a7
parent684a1a17674d92682c9d91c4e944e1a31b0bcda4 (diff)
downloadgitlab-ce-470a86670fed96899a342f0b53a047799921055d.tar.gz
Add missing argument to DeploymentService#predefined_variablesfix_deployment_service_predefined_variables
-rw-r--r--app/models/project_services/deployment_service.rb2
-rw-r--r--spec/factories/projects.rb4
-rw-r--r--spec/factories/services.rb6
-rw-r--r--spec/models/project_spec.rb8
4 files changed, 19 insertions, 1 deletions
diff --git a/app/models/project_services/deployment_service.rb b/app/models/project_services/deployment_service.rb
index 6dae4f3a4a6..80aa2101509 100644
--- a/app/models/project_services/deployment_service.rb
+++ b/app/models/project_services/deployment_service.rb
@@ -11,7 +11,7 @@ class DeploymentService < Service
%w()
end
- def predefined_variables
+ def predefined_variables(project:)
[]
end
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index 18fab395cc2..f7ef34d773b 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -322,6 +322,10 @@ FactoryBot.define do
kubernetes_service
end
+ factory :mock_deployment_project, parent: :project do
+ mock_deployment_service
+ end
+
factory :prometheus_project, parent: :project do
after :create do |project|
project.create_prometheus_service(
diff --git a/spec/factories/services.rb b/spec/factories/services.rb
index 5be56a49903..0d8c26a2ee9 100644
--- a/spec/factories/services.rb
+++ b/spec/factories/services.rb
@@ -26,6 +26,12 @@ FactoryBot.define do
})
end
+ factory :mock_deployment_service do
+ project
+ type 'MockDeploymentService'
+ active true
+ end
+
factory :prometheus_service do
project
active true
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index c1767ed0535..ac9362339e5 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -2548,6 +2548,14 @@ describe Project do
end
end
+ context 'when project uses mock deployment service' do
+ let(:project) { create(:mock_deployment_project) }
+
+ it 'returns an empty array' do
+ expect(project.deployment_variables).to eq []
+ end
+ end
+
context 'when project has a deployment service' do
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
it 'returns variables from this service' do