We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 638112f commit ed88a19Copy full SHA for ed88a19
lib/grape/endpoint.rb
@@ -83,6 +83,7 @@ def call(env)
83
end
84
85
def call!(env)
86
+ env['api.endpoint'] = self
87
if options[:app]
88
options[:app].call(env)
89
else
spec/grape/endpoint_spec.rb
@@ -14,6 +14,12 @@ def app; subject end
14
15
16
17
+ it 'should set itself in the env upon call' do
18
+ subject.get('/'){ "Hello world." }
19
+ get '/'
20
+ last_request.env['api.endpoint'].should be_kind_of(Grape::Endpoint)
21
+ end
22
+
23
describe '#status' do
24
it 'should be callable from within a block' do
25
subject.get('/home') do
0 commit comments