summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-01-12 18:19:11 +0000
committerDouwe Maan <douwe@gitlab.com>2017-01-12 18:19:11 +0000
commit764fc0dd69b3e064d4b14ce8125fbb6daa98cf7f (patch)
tree4fb246d493ca1a9f52790e906f63aeafd2c95bb6 /spec
parent6ebbecdd3c1a13bc88a15ed2509e67e6aae8b9eb (diff)
parent9db19ae090195b1b594c554679b9f9a0aefab4bc (diff)
downloadgitlab-ce-764fc0dd69b3e064d4b14ce8125fbb6daa98cf7f.tar.gz
Merge branch 'zj-unadressable-url-variables' into 'master'
Do not check for valid url for .gitlab-ci.yml Closes #22970 See merge request !8451
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb13
-rw-r--r--spec/lib/gitlab/ci/config/entry/environment_spec.rb17
2 files changed, 13 insertions, 17 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index 62d68721574..f824e2e1efe 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -769,6 +769,19 @@ module Ci
expect(builds.first[:environment]).to eq(environment[:name])
expect(builds.first[:options]).to include(environment: environment)
end
+
+ context 'the url has a port as variable' do
+ let(:environment) do
+ { name: 'production',
+ url: 'http://production.gitlab.com:$PORT' }
+ end
+
+ it 'allows a variable for the port' do
+ expect(builds.size).to eq(1)
+ expect(builds.first[:environment]).to eq(environment[:name])
+ expect(builds.first[:options]).to include(environment: environment)
+ end
+ end
end
context 'when no environment is specified' do
diff --git a/spec/lib/gitlab/ci/config/entry/environment_spec.rb b/spec/lib/gitlab/ci/config/entry/environment_spec.rb
index d97806295fb..2adbed2154f 100644
--- a/spec/lib/gitlab/ci/config/entry/environment_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/environment_spec.rb
@@ -196,22 +196,5 @@ describe Gitlab::Ci::Config::Entry::Environment do
end
end
end
-
- context 'when invalid URL is used' do
- let(:config) { { name: 'test', url: 'invalid-example.gitlab.com' } }
-
- describe '#valid?' do
- it 'is not valid' do
- expect(entry).not_to be_valid
- end
- end
-
- describe '#errors?' do
- it 'contains error about invalid URL' do
- expect(entry.errors)
- .to include "environment url must be a valid url"
- end
- end
- end
end
end