syntropy 0.27 → 0.27.1
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/CHANGELOG.md +4 -0
- data/lib/syntropy/errors.rb +1 -1
- data/lib/syntropy/request_extensions.rb +2 -2
- data/lib/syntropy/version.rb +1 -1
- data/test/app/api+.rb +1 -1
- data/test/test_app.rb +4 -4
- data/test/test_errors.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd5a77712915e9472ed58a8786dce7369e9d24852533c19ce25d9f4959815bf
|
4
|
+
data.tar.gz: d6420486dc63bb1227b723f14e28e170e6e772f28970a2ce62e2d8283bdcd2b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5041a3820ed58393b643c7ed298fbdfedf255b9116156a1909d39bf0dfbb842004b38a651c85419d28c5dc2cae9b1c0d5fb13a9e24bbb1ec5340508ffbe7591c
|
7
|
+
data.tar.gz: d239554ae9e5b8c1b3159cbc0bb13cc828d2b00a4cf376197aaeb7740c57ae49d6419ccb957893bc6a1026d2db273a77f25a2960e6c21d84dad68528bf2ebf97
|
data/CHANGELOG.md
CHANGED
data/lib/syntropy/errors.rb
CHANGED
@@ -177,12 +177,12 @@ module Syntropy
|
|
177
177
|
def get_form_data
|
178
178
|
body = read
|
179
179
|
if !body || body.empty?
|
180
|
-
raise Syntropy::Error.new(
|
180
|
+
raise Syntropy::Error.new('Missing form data', Qeweney::Status::BAD_REQUEST)
|
181
181
|
end
|
182
182
|
|
183
183
|
Qeweney::Request.parse_form_data(body, headers)
|
184
184
|
rescue Qeweney::BadRequestError
|
185
|
-
raise Syntropy::Error.new(
|
185
|
+
raise Syntropy::Error.new('Invalid form data', Qeweney::Status::BAD_REQUEST)
|
186
186
|
end
|
187
187
|
|
188
188
|
def html_response(html, **headers)
|
data/lib/syntropy/version.rb
CHANGED
data/test/app/api+.rb
CHANGED
data/test/test_app.rb
CHANGED
@@ -50,7 +50,7 @@ class AppTest < Minitest::Test
|
|
50
50
|
|
51
51
|
req = make_request(':method' => 'POST', ':path' => '/test')
|
52
52
|
assert_equal Status::METHOD_NOT_ALLOWED, req.response_status
|
53
|
-
|
53
|
+
assert_equal "Method not allowed", req.response_body
|
54
54
|
|
55
55
|
req = make_request(':method' => 'GET', ':path' => '/test/assets/style.css')
|
56
56
|
assert_equal '* { color: beige }', req.response_body
|
@@ -64,7 +64,7 @@ class AppTest < Minitest::Test
|
|
64
64
|
|
65
65
|
req = make_request(':method' => 'POST', ':path' => '/test/api?q=get')
|
66
66
|
assert_equal Status::METHOD_NOT_ALLOWED, req.response_status
|
67
|
-
assert_equal({ status: 'Error', message: '' }, req.response_json)
|
67
|
+
assert_equal({ status: 'Error', message: 'Method not allowed' }, req.response_json)
|
68
68
|
|
69
69
|
req = make_request(':method' => 'GET', ':path' => '/test/api/foo?q=get')
|
70
70
|
assert_equal({ status: 'OK', response: 0 }, req.response_json)
|
@@ -74,7 +74,7 @@ class AppTest < Minitest::Test
|
|
74
74
|
|
75
75
|
req = make_request(':method' => 'GET', ':path' => '/test/api?q=incr')
|
76
76
|
assert_equal Status::METHOD_NOT_ALLOWED, req.response_status
|
77
|
-
assert_equal({ status: 'Error', message: '' }, req.response_json)
|
77
|
+
assert_equal({ status: 'Error', message: 'Method not allowed' }, req.response_json)
|
78
78
|
|
79
79
|
req = make_request(':method' => 'POST', ':path' => '/test/api/foo?q=incr')
|
80
80
|
assert_equal({ status: 'Error', message: 'Teapot' }, req.response_json)
|
@@ -97,7 +97,7 @@ class AppTest < Minitest::Test
|
|
97
97
|
assert_equal Status::OK, req.response_status
|
98
98
|
|
99
99
|
req = make_request(':method' => 'POST', ':path' => '/test/baz')
|
100
|
-
|
100
|
+
assert_equal 'Method not allowed', req.response_body
|
101
101
|
assert_equal Status::METHOD_NOT_ALLOWED, req.response_status
|
102
102
|
|
103
103
|
req = make_request(':method' => 'GET', ':path' => '/test/about')
|
data/test/test_errors.rb
CHANGED
@@ -12,7 +12,7 @@ class ErrorsTest < Minitest::Test
|
|
12
12
|
e = Syntropy::Error.new
|
13
13
|
assert_equal ISE, Syntropy::Error.http_status(e)
|
14
14
|
|
15
|
-
e = Syntropy::Error.new(Qeweney::Status::UNAUTHORIZED)
|
15
|
+
e = Syntropy::Error.new("", Qeweney::Status::UNAUTHORIZED)
|
16
16
|
assert_equal Qeweney::Status::UNAUTHORIZED, Syntropy::Error.http_status(e)
|
17
17
|
end
|
18
18
|
|