Skip to content

Commit 6010d59

Browse files
author
Lester Celestial
committed
added spec for validations on wrong endpoint
1 parent 1bcbfb0 commit 6010d59

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

spec/grape/validations/presence_spec.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff 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('/')

0 commit comments

Comments
 (0)