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 committed Jul 15, 2015
1 parent 735034b commit 002d84d
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 @@ -2857,6 +2857,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 002d84d

Please sign in to comment.