lib/airborne/request_expectations.rb in airborne-0.2.11 vs lib/airborne/request_expectations.rb in airborne-0.2.12
- old
+ new
@@ -99,11 +99,11 @@
def expect_json_types_impl(expected, actual)
return if nil_optional_hash?(expected, actual)
@mapper ||= get_mapper
- actual = convert_to_date(actual) if expected == :date
+ actual = convert_to_date(actual) if ((expected == :date) || (expected == :date_or_null))
return expect_type(expected, actual) if expected.is_a?(Symbol)
return expected.call(actual) if expected.is_a?(Proc)
keys = []
@@ -113,10 +113,10 @@
keys = expected.keys & actual.keys if match_none?
keys.flatten.uniq.each do |prop|
type = extract_expected_type(expected, prop)
value = extract_actual(actual, prop)
- value = convert_to_date(value) if type == :date
+ value = convert_to_date(value) if ((type == :date) || (type == :date_or_null))
next expect_json_types_impl(type, value) if hash?(type)
next type.call(value) if type.is_a?(Proc)
type_string = type.to_s