diff options
author | Stan Hu <stanhu@gmail.com> | 2018-05-30 02:57:46 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-05-30 03:15:03 -0700 |
commit | 990af4fb5dcc08894578cc7d1dd24176c1cbcef2 (patch) | |
tree | 20fba8c1147ea8c4a4c781daffe5d6773af33372 /spec | |
parent | 5b1416aa74c4fa80e0c324fd2907166af5ca479b (diff) | |
download | gitlab-ce-990af4fb5dcc08894578cc7d1dd24176c1cbcef2.tar.gz |
Replace grape-route-helpers with our own grape-path-helpers
This gem (https://gitlab.com/gitlab-org/grape-path-helpers) makes a number of changes:
1. Brings in @mdelaossa's changes in https://github.com/reprah/grape-route-helpers/pull/21
2. Fixes some broken specs and code for Grape 1.0+
3. Optimizes the generation of paths by bringing in @dblessing's
HashWithIndifferentAccess changes in https://gitlab.com/gitlab-org/gitlab-ce/issues/45718#note_70123793
Closes #45718
Diffstat (limited to 'spec')
-rw-r--r-- | spec/initializers/grape_route_helpers_fix_spec.rb | 14 | ||||
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 12 |
2 files changed, 12 insertions, 14 deletions
diff --git a/spec/initializers/grape_route_helpers_fix_spec.rb b/spec/initializers/grape_route_helpers_fix_spec.rb deleted file mode 100644 index 2cf5924128f..00000000000 --- a/spec/initializers/grape_route_helpers_fix_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -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 diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 1eeeb4f1045..16412a0ea87 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -29,6 +29,18 @@ describe API::MergeRequests do project.add_reporter(user) end + describe 'route shadowing' do + include GrapePathHelpers::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 + describe 'GET /merge_requests' do context 'when unauthenticated' do it 'returns an array of all merge requests' do |