summaryrefslogtreecommitdiff
path: root/spec/models/ci/build_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r--spec/models/ci/build_spec.rb23
1 files changed, 21 insertions, 2 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 757c158e16a..6c77b16f908 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -2542,6 +2542,8 @@ describe Ci::Build do
<<~ROUTEMAP
- source: 'bar/branch-test.txt'
public: '/bar/branches'
+ - source: 'with space/README.md'
+ public: '/README'
ROUTEMAP
end
@@ -2556,10 +2558,27 @@ describe Ci::Build do
let(:environment) { create(:environment, project: merge_request.project, name: "foo-#{project.default_branch}") }
let(:build) { create(:ci_build, pipeline: pipeline, environment: environment.name) }
+ let(:full_urls) do
+ [
+ File.join(environment.external_url, '/bar/branches'),
+ File.join(environment.external_url, '/README')
+ ]
+ end
+
it 'populates CI_MERGE_REQUEST_CHANGED_PAGES_* variables' do
expect(subject).to include(
- { key: 'CI_MERGE_REQUEST_CHANGED_PAGE_PATHS', value: '/bar/branches', public: true, masked: false },
- { key: 'CI_MERGE_REQUEST_CHANGED_PAGE_URLS', value: File.join(environment.external_url, '/bar/branches'), public: true, masked: false }
+ {
+ key: 'CI_MERGE_REQUEST_CHANGED_PAGE_PATHS',
+ value: '/bar/branches,/README',
+ public: true,
+ masked: false
+ },
+ {
+ key: 'CI_MERGE_REQUEST_CHANGED_PAGE_URLS',
+ value: full_urls.join(','),
+ public: true,
+ masked: false
+ }
)
end