diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-08-08 02:41:39 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-08-08 20:30:07 +0300 |
commit | fccd64bb6ae0b06252cf667492ca5e5a0753c4f4 (patch) | |
tree | b3b1072b9c6a4f07793165850b1af650f08e54d2 /spec/models/redirect_route_spec.rb | |
parent | cfabe7bf38f175b28c8c0a1bec584b6b751cbba5 (diff) |
Fix conflicting redirect search
Diffstat (limited to 'spec/models/redirect_route_spec.rb')
-rw-r--r-- | spec/models/redirect_route_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/models/redirect_route_spec.rb b/spec/models/redirect_route_spec.rb index 80943877095..106ae59af29 100644 --- a/spec/models/redirect_route_spec.rb +++ b/spec/models/redirect_route_spec.rb @@ -20,8 +20,16 @@ describe RedirectRoute do let!(:redirect4) { group.redirect_routes.create(path: 'gitlabb/test/foo/bar') } let!(:redirect5) { group.redirect_routes.create(path: 'gitlabb/test/baz') } - it 'returns correct routes' do - expect(described_class.matching_path_and_descendants('gitlabb/test')).to match_array([redirect2, redirect3, redirect4, redirect5]) + context 'when the redirect route matches with same casing' do + it 'returns correct routes' do + expect(described_class.matching_path_and_descendants('gitlabb/test')).to match_array([redirect2, redirect3, redirect4, redirect5]) + end + end + + context 'when the redirect route matches with different casing' do + it 'returns correct routes' do + expect(described_class.matching_path_and_descendants('GitLABB/test')).to match_array([redirect2, redirect3, redirect4, redirect5]) + end end end end |