summaryrefslogtreecommitdiff
path: root/spec/initializers
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2018-01-29 14:56:43 -0600
committerMario de la Ossa <mariodelaossa@gmail.com>2018-01-29 15:28:14 -0600
commit233a9861113df678e1f54dfbd13d9ab23fd5d5a0 (patch)
treefa1b31885265303c7f92726707a468a9f734f957 /spec/initializers
parent55f28ebbf64d98389cb5f0491c031af5591b9f5e (diff)
downloadgitlab-ce-233a9861113df678e1f54dfbd13d9ab23fd5d5a0.tar.gz
Fix grape-route-helper route shadowinggrape-router-helpers-bugfix
Bringing in https://github.com/reprah/grape-route-helpers/pull/21 as a monkey patch since the grape-route-helpers project seems to be abandoned
Diffstat (limited to 'spec/initializers')
-rw-r--r--spec/initializers/grape_route_helpers_fix_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/initializers/grape_route_helpers_fix_spec.rb b/spec/initializers/grape_route_helpers_fix_spec.rb
new file mode 100644
index 00000000000..2cf5924128f
--- /dev/null
+++ b/spec/initializers/grape_route_helpers_fix_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+require_relative '../../config/initializers/grape_route_helpers_fix'
+
+describe 'route shadowing' do
+ include GrapeRouteHelpers::NamedRouteMatcher
+
+ it 'does not occur' do
+ path = api_v4_projects_merge_requests_path(id: 1)
+ expect(path).to eq('/api/v4/projects/1/merge_requests')
+
+ path = api_v4_projects_merge_requests_path(id: 1, merge_request_iid: 3)
+ expect(path).to eq('/api/v4/projects/1/merge_requests/3')
+ end
+end