File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ def nest(*blocks, &block)
386386 instance_eval &block if block_given?
387387 blocks . each { |b | instance_eval &b }
388388 settings . pop # when finished, we pop the context
389+ reset_validations!
389390 else
390391 instance_eval &block
391392 end
Original file line number Diff line number Diff line change @@ -6,7 +6,13 @@ module ValidationsSpec
66 module PresenceValidatorSpec
77 class API < Grape ::API
88 default_format :json
9-
9+
10+ resource :bacons do
11+ get do
12+ "All the bacon"
13+ end
14+ end
15+
1016 params do
1117 requires :id , :regexp => /^[0-9]+$/
1218 end
@@ -27,6 +33,12 @@ class API < Grape::API
2733 def app
2834 ValidationsSpec ::PresenceValidatorSpec ::API
2935 end
36+
37+ it "does not validate for any params" do
38+ get ( "/bacons" )
39+ last_response . status . should == 200
40+ last_response . body . should == "All the bacon"
41+ end
3042
3143 it 'validates id' do
3244 post ( '/' )
You can’t perform that action at this time.
0 commit comments