-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression with optional parameters #1307
Labels
Comments
Another much simpler spec not fixed above. require 'spec_helper'
describe Grape::Endpoint do
subject { Class.new(Grape::API) }
def app
subject
end
before do
subject.namespace :api do
get ':id' do
[params[:id], params[:ext]].compact.join('/')
end
put ':something_id' do
params[:something_id]
end
end
end
context 'get' do
it 'responds' do
get '/api/foo'
expect(last_response.status).to eq 200
expect(last_response.body).to eq 'foo'
end
end
context 'put' do
it 'responds' do
put '/api/foo'
expect(last_response.status).to eq 200
expect(last_response.body).to eq 'foo'
end
end
end |
Another one: require 'spec_helper'
describe Grape::Endpoint do
subject { Class.new(Grape::API) }
def app
subject
end
before do
subject.namespace :me do
namespace :pending do
get '/' do
'banana'
end
end
put ':id' do
params[:id]
end
end
end
context 'get' do
it 'responds without ext' do
get '/me/pending'
expect(last_response.status).to eq 200
expect(last_response.body).to eq 'banana'
end
end
context 'put' do
it 'responds' do
put '/me/foo'
expect(last_response.status).to eq 200
expect(last_response.body).to eq 'foo'
end
end
end |
przbadu
pushed a commit
to przbadu/grape
that referenced
this issue
Apr 5, 2016
przbadu
pushed a commit
to przbadu/grape
that referenced
this issue
Apr 5, 2016
przbadu
pushed a commit
to przbadu/grape
that referenced
this issue
Apr 5, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Regression from #1263
Passes in 0.14.0, fails on HEAD (0.15.0)
The text was updated successfully, but these errors were encountered: