Return invalid response when document_type or document_number are empty
Probably this case is not real for production environments where those arguments will always be fullfilled but seems to be interesting for testing environment where this method is being called when those paremeters where empty.
This commit is contained in:
committed by
Javi Martín
parent
06dcbd699c
commit
93e458d46e
@@ -1,5 +1,7 @@
|
||||
class CensusCaller
|
||||
def call(document_type, document_number, date_of_birth, postal_code)
|
||||
return Response.new if document_number.blank? || document_type.blank?
|
||||
|
||||
if Setting["feature.remote_census"].present?
|
||||
response = RemoteCensusApi.new.call(document_type, document_number, date_of_birth, postal_code)
|
||||
else
|
||||
@@ -9,4 +11,10 @@ class CensusCaller
|
||||
|
||||
response
|
||||
end
|
||||
|
||||
class Response
|
||||
def valid?
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user