agile-proxy 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/agile_proxy/handlers/stub_handler.rb +5 -1
- data/lib/agile_proxy/version.rb +1 -1
- data/spec/integration/specs/lib/server_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9debf529ce58a4c1b629a0fcb240cbea68d2ad8b
|
4
|
+
data.tar.gz: cf140a73a3794a97a14f1f420d23762f70a7aeaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f84ca76bfc4a8e8305ce22a83ad494210de26e8b4d5121cd018f79a4c87cc29306635116fe92823653a894b620f1294113942e90a58ad1520f7b10bff972965
|
7
|
+
data.tar.gz: 9e6da7607628bc29d4dda9d17c5d6481b27098aa53c02029efae899bf20431627f6729af915f979d8e614f577b56e519e9d5dd8b1af21b39e361359057721f6d
|
data/Gemfile.lock
CHANGED
@@ -89,7 +89,11 @@ module AgileProxy
|
|
89
89
|
|
90
90
|
def plain_text_handler
|
91
91
|
proc do |raw_post|
|
92
|
-
data_as_array = raw_post.split("\n").map
|
92
|
+
data_as_array = raw_post.split("\n").map do |line|
|
93
|
+
arr = line.split('=')
|
94
|
+
arr << nil if arr.length == 1
|
95
|
+
arr
|
96
|
+
end.flatten
|
93
97
|
data = Hash[*data_as_array]
|
94
98
|
ActionDispatch::Request::Utils.deep_munge(data).with_indifferent_access
|
95
99
|
end
|
data/lib/agile_proxy/version.rb
CHANGED
@@ -90,6 +90,12 @@ shared_examples_for 'a request stub' do |options = {}|
|
|
90
90
|
expect(resp.status).to eql 200
|
91
91
|
expect(resp.headers['Content-Type']).to eql 'text/html'
|
92
92
|
end
|
93
|
+
it 'Should match the route by posted plain text data and the posted data can be output via the template' do
|
94
|
+
resp = http.post '/api/forums/my_forum', "dummy=\nposted_var=special_value\n", 'Content-Type' => 'text/plain'
|
95
|
+
expect(resp.body).to eql '<html><body><h1></h1><h2>special_value</h2><h3>my_forum</h3><p>This should get data from the POSTed data</p></body></html>'
|
96
|
+
expect(resp.status).to eql 200
|
97
|
+
expect(resp.headers['Content-Type']).to eql 'text/html'
|
98
|
+
end
|
93
99
|
# it 'Should match the route by posted xml data and the posted data can be output via the template' do
|
94
100
|
# resp = http.post "/api/forums/my_forum", '<posted_var>special_value</posted_var>', {'Content-Type' => 'application/xml'}
|
95
101
|
# expect(resp.body).to eql '<html><body><h1></h1><h2>special_value</h2><h3>my_forum</h3><p>This should get data from the POSTed data</p></body></html>'
|