Skip to content

Commit 8e2906f

Browse files
author
Jerry Cheung
committed
Merge branch 'master' of https://github.com/merchii/grape into intridea/master
2 parents 2dc1eac + a4a06f8 commit 8e2906f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/grape/api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ def post(paths = ['/'], options = {}, &block); route('POST', paths, options, &bl
284284
def put(paths = ['/'], options = {}, &block); route('PUT', paths, options, &block) end
285285
def head(paths = ['/'], options = {}, &block); route('HEAD', paths, options, &block) end
286286
def delete(paths = ['/'], options = {}, &block); route('DELETE', paths, options, &block) end
287+
def options(paths = ['/'], options = {}, &block); route('OPTIONS', paths, options, &block) end
287288

288289
def namespace(space = nil, &block)
289290
if space || block_given?

spec/grape/api_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,13 @@ def app; subject end
238238
"lol"
239239
end
240240

241-
%w(get post put delete).each do |m|
241+
%w(get post put delete options).each do |m|
242242
send(m, '/abc')
243243
last_response.body.should eql 'lol'
244244
end
245245
end
246246

247-
verbs = %w(post get head delete put)
247+
verbs = %w(post get head delete put options)
248248
verbs.each do |verb|
249249
it "should allow and properly constrain a #{verb.upcase} method" do
250250
subject.send(verb, '/example') do

0 commit comments

Comments
 (0)