WpTimthumb::Existable specs
This commit is contained in:
@@ -8,5 +8,4 @@ class WpTimthumb < WpItem
|
||||
include WpTimthumb::Versionable
|
||||
include WpTimthumb::Existable
|
||||
include WpTimthumb::Output
|
||||
|
||||
end
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
class WpTimthumb < WpItem
|
||||
module Existable
|
||||
|
||||
# @param [ Typhoeus::Response ] response
|
||||
# @param [ Hash ] options
|
||||
#
|
||||
# @return [ Boolean ]
|
||||
def exists_from_response?(response, options = {})
|
||||
response.code == 400 && response.body =~ /no image specified/i ? true : false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user