Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-14 23:32:11 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 11:07:13 +0300
commite1b3ab5af290f6d2eeb56c4b72e341324414a6d2 (patch)
treec5d5bb4e3d167ee8f82ab6bd1ba4955cc77a2d11 /spec/models/environment_spec.rb
parent2cc9a785dfdada5e2976b8341d3c9e6eae8fa66f (diff)
Verify expandability of variables defined as part of environment
Diffstat (limited to 'spec/models/environment_spec.rb')
-rw-r--r--spec/models/environment_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb
index c881897926e..7afc7ec5ca1 100644
--- a/spec/models/environment_spec.rb
+++ b/spec/models/environment_spec.rb
@@ -63,4 +63,20 @@ describe Environment, models: true do
end
end
end
+
+ describe '#environment_type' do
+ subject { environment.environment_type }
+
+ it 'sets a environment type if name has multiple segments' do
+ environment.update(name: 'production/worker.gitlab.com')
+
+ is_expected.to eq('production')
+ end
+
+ it 'nullifies a type if it\'s a simple name' do
+ environment.update(name: 'production')
+
+ is_expected.to be_nil
+ end
+ end
end