Created
December 20, 2014 04:21
-
-
Save ppadron/2d40ccd7a3349366dd8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment