aboutsummaryrefslogtreecommitdiff
path: root/spec/unit/request/parameter/element_reference_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/request/parameter/element_reference_spec.rb')
-rw-r--r--spec/unit/request/parameter/element_reference_spec.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/spec/unit/request/parameter/element_reference_spec.rb b/spec/unit/request/parameter/element_reference_spec.rb
deleted file mode 100644
index 1136eae..0000000
--- a/spec/unit/request/parameter/element_reference_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'spec_helper'
-
-describe Zero::Request::Parameter, '#[]' do
- subject { Zero::Request::Parameter.new(env) }
-
- context 'without parameters' do
- let(:env) { EnvGenerator.get('/foo') }
-
- it 'returns the custom parameter' do
- subject['foo'] = 'bar'
- expect(subject['foo']).to eq('bar')
- end
- end
-
- context 'with query parameters' do
- let(:env) { EnvGenerator.get('/foo?foo=bar') }
-
- it 'returns the query parameter' do
- expect(subject['foo']).to eq('bar')
- end
-
- it 'returns the custom parameter' do
- subject['foo'] = 'baz'
- expect(subject['foo']).to eq('baz')
- end
- end
-
- context 'with payload parameters' do
- let(:env) do
- EnvGenerator.post('/foo', {
- :input => 'foo=bar', 'CONTENT_TYPE' => 'multipart/form-data'
- })
- end
-
- it 'returns the payload value' do
- expect(subject['foo']).to eq('bar')
- end
-
- it 'returns the custom parameter' do
- subject['foo'] = 'baz'
- expect(subject['foo']).to eq('baz')
- end
- end
-
- context 'with query and payload parameters' do
- let(:env) do
- EnvGenerator.post('/foo?foo=baz', {
- :input => 'foo=bar', 'CONTENT_TYPE' => 'multipart/form-data'
- })
- end
-
- it 'returns the payload parameter' do
- expect(subject['foo']).to eq('bar')
- end
- end
-end