Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions spec/grape/api/shared_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
end
end

nested = Class.new(Grape::API) do
params do
use :pagination
end
get '/child' do
declared(params, include_missing: true)
end
end

Class.new(Grape::API) do
helpers shared_params
format :json
Expand All @@ -23,6 +32,8 @@
get do
declared(params, include_missing: true)
end

mount nested
end
end

Expand All @@ -35,4 +46,10 @@ def app
expect(last_response.status).to eq 200
expect(last_response.body).to eq({ page: nil, size: nil }.to_json)
end

it 'inherits parameters' do
get '/child'
expect(last_response.status).to eq 200
expect(last_response.body).to eq({ page: nil, size: nil }.to_json)
end
end