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:
parent
5149dc9e0b
commit
df87572b0d
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue