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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-24 13:51:17 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-24 13:51:17 +0300
commit672704f6389104b3d93c00a116dd4dc8ece19136 (patch)
tree9c1d02e77f0a654b214b2b8923a0ce281f258158 /spec/lib/constraints
parent1a7ba2a5e8603222b51a9e9cf0ffcde68cf593d2 (diff)
Add relative url support to routing contrainers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/lib/constraints')
-rw-r--r--spec/lib/constraints/namespace_url_constrainer_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/constraints/namespace_url_constrainer_spec.rb b/spec/lib/constraints/namespace_url_constrainer_spec.rb
index a5feaacb8ee..7814711fe27 100644
--- a/spec/lib/constraints/namespace_url_constrainer_spec.rb
+++ b/spec/lib/constraints/namespace_url_constrainer_spec.rb
@@ -17,6 +17,16 @@ describe NamespaceUrlConstrainer, lib: true do
it { expect(subject.matches?(request '/g/gitlab')).to be_falsey }
it { expect(subject.matches?(request '/.gitlab')).to be_falsey }
end
+
+ context 'relative url' do
+ before do
+ allow(Gitlab::Application.config).to receive(:relative_url_root) { '/gitlab' }
+ end
+
+ it { expect(subject.matches?(request '/gitlab/gitlab')).to be_truthy }
+ it { expect(subject.matches?(request '/gitlab/gitlab-ce')).to be_falsey }
+ it { expect(subject.matches?(request '/gitlab/')).to be_falsey }
+ end
end
def request(path)