Skip to content

Commit

Permalink
Add test for OPTIONS and HEAD requests with catch-all
Browse files Browse the repository at this point in the history
This illustrates the issue described in ruby-grape#1056 by adding a options and
head request when the catch-all route is enabled.
  • Loading branch information
ekampp authored and namusyaka committed Mar 16, 2016
1 parent 2166237 commit de2719f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3046,6 +3046,12 @@ def before
get '/v2/hello'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('v2')
options '/v2/hello'
expect(last_response.status).to eq(200)
expect(last_response.body).to be_blank
head '/v2/hello'
expect(last_response.status).to eq(200)
expect(last_response.body).to be_blank
get '/foobar'
expect(last_response.status).to eq(404)
expect(last_response.body).to eq('Unrecognized request path: foobar - /foobar')
Expand Down

0 comments on commit de2719f

Please sign in to comment.