From 3a82183563986d368e81b5c314e69f169805fd1f Mon Sep 17 00:00:00 2001 From: Stormwind Date: Sun, 6 Jan 2013 20:24:39 +0100 Subject: Improve test structure Created folder spec/unit/zero and moved all unittest into this folder. --- spec/unit/request/parameter/payload_spec.rb | 43 ----------------------------- 1 file changed, 43 deletions(-) delete mode 100644 spec/unit/request/parameter/payload_spec.rb (limited to 'spec/unit/request/parameter/payload_spec.rb') diff --git a/spec/unit/request/parameter/payload_spec.rb b/spec/unit/request/parameter/payload_spec.rb deleted file mode 100644 index 563b21d..0000000 --- a/spec/unit/request/parameter/payload_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -require 'spec_helper' - -describe Zero::Request::Parameter, '#payload' do - subject { Zero::Request::Parameter.new(env) } - - context 'without parameters' do - let(:env) { EnvGenerator.get('/foo') } - its(:payload) { should == {} } - end - - context 'with a query string' do - let(:env) { EnvGenerator.get('/foo?bar=baz') } - its(:payload) { should == {} } - end - - context 'with a post body' do - let(:env) do - EnvGenerator.post('/foo', { - :input => 'bar=baz', 'CONTENT_TYPE' => 'multipart/form-data' - }) - end - its(:payload) { should == {'bar' => 'baz'} } - end - - context 'with special characters' do - let(:env) do - EnvGenerator.post('/foo', { - :input => 'bar=foo%20bar', 'CONTENT_TYPE' => 'multipart/form-data' - }) - end - its(:payload) { should == {'bar' => 'foo bar'} } - end - - # TODO behaves like this, but is this really good like this? - context 'with a post body and content type application/json' do - let(:env) do - EnvGenerator.post('/foo', { - :input => '"foobar"', 'CONTENT_TYPE' => 'application/json' - }) - end - its(:payload) { should == {} } - end -end -- cgit v1.2.3-70-g09d2