0
0
Fork 0

added specs for #query

This commit is contained in:
Gibheer 2012-11-14 20:11:54 +01:00
parent cd046bf278
commit 51d2612dc5
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
require 'spec_helper'
describe Zero::Request::Parameter, '#query' do
subject { Zero::Request::Parameter.new(env) }
context "without parameters" do
let(:env) { EnvGenerator.get('/foo') }
its(:query) { should == {} }
end
context "with a query string" do
let(:env) { EnvGenerator.get('/foo?bar=baz') }
its(:query) { should == {'bar' => 'baz'} }
end
context "with a post body" do
let(:env) { EnvGenerator.post('/foo', {:input => 'bar=baz'}) }
its(:query) { should == {} }
end
end