diff options
Diffstat (limited to 'spec/unit/request/parameter/query_spec.rb')
-rw-r--r-- | spec/unit/request/parameter/query_spec.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/unit/request/parameter/query_spec.rb b/spec/unit/request/parameter/query_spec.rb index 5a3964b..940e80e 100644 --- a/spec/unit/request/parameter/query_spec.rb +++ b/spec/unit/request/parameter/query_spec.rb @@ -3,18 +3,23 @@ require 'spec_helper' describe Zero::Request::Parameter, '#query' do subject { Zero::Request::Parameter.new(env) } - context "without parameters" do + context 'without parameters' do let(:env) { EnvGenerator.get('/foo') } its(:query) { should == {} } end - context "with a query string" do + 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 + context 'with a post body' do let(:env) { EnvGenerator.post('/foo', {:input => 'bar=baz'}) } its(:query) { should == {} } end + + context 'with special characters' do + let(:env) { EnvGenerator.get('/foo?bar=foo%20bar') } + its(:query) { should == {'bar' => 'foo bar'} } + end end |