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)
386
386
instance_eval &block if block_given?
387
387
blocks . each { |b | instance_eval &b }
388
388
settings . pop # when finished, we pop the context
389
+ reset_validations!
389
390
else
390
391
instance_eval &block
391
392
end
Original file line number Diff line number Diff line change @@ -6,7 +6,13 @@ module ValidationsSpec
6
6
module PresenceValidatorSpec
7
7
class API < Grape ::API
8
8
default_format :json
9
-
9
+
10
+ resource :bacons do
11
+ get do
12
+ "All the bacon"
13
+ end
14
+ end
15
+
10
16
params do
11
17
requires :id , :regexp => /^[0-9]+$/
12
18
end
@@ -27,6 +33,12 @@ class API < Grape::API
27
33
def app
28
34
ValidationsSpec ::PresenceValidatorSpec ::API
29
35
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
30
42
31
43
it 'validates id' do
32
44
post ( '/' )
You can’t perform that action at this time.
0 commit comments