Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it 'should not consider as a missing attribute a value that evaluates to false' do
- subject.params do
- requires :first
- optional :false
- end
- subject.post '/declared' do
- error!('expected false', 400) if declared(params, include_missing: false)[:false] != false
- ''
- end
- post '/declared', MultiJson.dump(first: 'one', false: false), 'CONTENT_TYPE' => 'application/json'
- expect(last_response.status).to eq(201)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement