Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. it 'should not consider as a missing attribute a value that evaluates to false' do
  2. subject.params do
  3. requires :first
  4. optional :false
  5. end
  6.  
  7. subject.post '/declared' do
  8. error!('expected false', 400) if declared(params, include_missing: false)[:false] != false
  9. ''
  10. end
  11.  
  12. post '/declared', MultiJson.dump(first: 'one', false: false), 'CONTENT_TYPE' => 'application/json'
  13. expect(last_response.status).to eq(201)
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement