1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Contrib: add an example to required params spec

Ensures that required_params doesn't fail
abruptly when a key in params it expected
to be a hash turns out to not be.

It fails currently.
This commit is contained in:
Arpit 2018-05-29 00:12:57 +05:30
parent 5149dc9e0b
commit df87572b0d
No known key found for this signature in database
GPG key ID: 71E79889EB580242

View file

@ -41,6 +41,10 @@ describe Sinatra::RequiredParams do
get('/', :p1 => 1, :p2 => {:p21 => 21})
expect(last_response.status).to eq(200)
end
it 'return 400 if p2 is not a hash' do
get('/', :p1 => 1, :p2 => 2)
expect(last_response.status).to eq(400)
end
end
context "complex keys" do
before do