Skip to content

Commit 43f8e8c

Browse files
committed
updating CHANGELOG.md
1 parent 3e5e884 commit 43f8e8c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
* [#1479](https://github.com/ruby-grape/grape/pull/1479): Support inserting middleware before/after anonymous classes in the middleware stack - [@rosa](https://github.com/rosa).
1313
* [#1488](https://github.com/ruby-grape/grape/pull/1488): Ensure calling before filters when receiving OPTIONS request - [@namusyaka](https://github.com/namusyaka), [@jlfaber](https://github.com/jlfaber).
14+
* [#1493](https://github.com/ruby-grape/grape/pull/1493): Coercion and lambda fails params validation - [@jonmchan](https://github.com/jonmchan).
1415

1516
0.17.0 (7/29/2016)
1617
==================

spec/grape/validations/params_scope_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def initialize(value)
159159

160160
context 'coercing values validation with proc' do
161161
it 'allows the proc to pass validation without checking' do
162-
subject.params { requires :numbers, type: Integer, values: -> { [0,1,2] } }
162+
subject.params { requires :numbers, type: Integer, values: -> { [0, 1, 2] } }
163163

164164
subject.post('/required') { 'coercion with proc works' }
165165
post '/required', numbers: '1'
@@ -168,7 +168,7 @@ def initialize(value)
168168
end
169169

170170
it 'allows the proc to pass validation without checking in value' do
171-
subject.params { requires :numbers, type: Integer, values: { value: -> { [0,1,2] } } }
171+
subject.params { requires :numbers, type: Integer, values: { value: -> { [0, 1, 2] } } }
172172

173173
subject.post('/required') { 'coercion with proc works' }
174174
post '/required', numbers: '1'
@@ -177,7 +177,7 @@ def initialize(value)
177177
end
178178

179179
it 'allows the proc to pass validation without checking in except' do
180-
subject.params { requires :numbers, type: Integer, values: { except: -> { [0,1,2] } } }
180+
subject.params { requires :numbers, type: Integer, values: { except: -> { [0, 1, 2] } } }
181181

182182
subject.post('/required') { 'coercion with proc works' }
183183
post '/required', numbers: '10'

spec/grape/validations/validators/values_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def app
438438
it 'allows any other value outside excepts' do
439439
get '/except/exclusive/lambda/coercion', type: '10010000'
440440
expect(last_response.status).to eq 200
441-
expect(last_response.body).to eq({ type: 10010000 }.to_json)
441+
expect(last_response.body).to eq({ type: 10_010_000 }.to_json)
442442
end
443443

444444
it 'rejects values that matches except' do

0 commit comments

Comments
 (0)