features/error-reporting.feature in httpimagestore-1.2.0 vs features/error-reporting.feature in httpimagestore-1.3.0
- old
+ new
@@ -7,11 +7,11 @@
Given httpthumbnailer server is running at http://localhost:3100/health_check
Given httpimagestore server is running at http://localhost:3000/health_check with the following configuration
"""
s3 key="@AWS_ACCESS_KEY_ID@" secret="@AWS_SECRET_ACCESS_KEY@" ssl=false
- path "structured-name" "#{dirname}/#{digest}/#{basename}-#{imagename}.#{mimeextension}"
+ path "structured-name" "#{dirname}/#{input_digest}/#{basename}-#{image_name}.#{image_mime_extension}"
path "missing" "blah"
path "zero" "zero"
put "multipart" ":name_list" {
thumbnail "input" {
@@ -42,10 +42,25 @@
}
get "zero" {
source_file "original" root="/dev" path="zero"
}
+
+ path "not_defined" "#{bogous}"
+ get "not_defined" {
+ source_file "original" root="/tmp" path="not_defined"
+ }
+
+ path "body" "#{input_digest}"
+ get "body" {
+ source_file "original" root="/tmp" path="body"
+ }
+
+ path "no_image_meta" "#{image_mime_extension}"
+ put "no_image_meta" {
+ store_file "input" root="/tmp" path="no_image_meta"
+ }
"""
@error-reporting
Scenario: Reporting of missing resource
When I do GET request http://localhost:3000/blah
@@ -146,11 +161,11 @@
And response body will be CRLF ended lines like
"""
thumbnailing of 'input' into 'bad_dim' failed: bad dimension value: 128x
"""
- @error-reporting
+ @error-reporting @413 @load
Scenario: Too large image - uploaded image too big to fit in memory limit
Given test-large.jpg file content as request body
When I do PUT request http://localhost:3000/multipart/large_png
Then response status will be 413
And response content type will be text/plain
@@ -164,11 +179,11 @@
And response body will be CRLF ended lines like
"""
thumbnailing of 'input' into 'large_png' failed: image too large: cache resources exhausted
"""
- @error-reporting
+ @error-reporting @413 @thumbnail
Scenario: Too large image - memory exhausted when thmbnailing
Given test.jpg file content as request body
When I do PUT request http://localhost:3000/multipart/superlarge
Then response status will be 413
And response content type will be text/plain
@@ -201,7 +216,38 @@
Then response status will be 413
And response content type will be text/plain
And response body will be CRLF ended lines like
"""
memory limit exceeded
+ """
+
+ @error-reporting @variables
+ Scenario: Bad variable use - not defined
+ When I do GET request http://localhost:3000/not_defined
+ Then response status will be 500
+ And response content type will be text/plain
+ And response body will be CRLF ended lines like
+ """
+ cannot generate path 'not_defined' from template '\#{bogous}': variable 'bogous' not defined
+ """
+
+ @error-reporting @variables
+ Scenario: Bad variable use - no body
+ When I do GET request http://localhost:3000/body
+ Then response status will be 500
+ And response content type will be text/plain
+ And response body will be CRLF ended lines like
+ """
+ cannot generate path 'body' from template '#{input_digest}': need not empty request body to generate value for 'input_digest'
+ """
+
+ @error-reporting @variables
+ Scenario: Bad variable use - no image meta
+ Given test.jpg file content as request body
+ When I do PUT request http://localhost:3000/no_image_meta
+ Then response status will be 500
+ And response content type will be text/plain
+ And response body will be CRLF ended lines like
+ """
+ cannot generate path 'no_image_meta' from template '#{image_mime_extension}': image 'input' does not have data for variable 'image_mime_extension'
"""