blob: e8cf1786124ee8b59e2229f29ff5a4f6857cd6f1 (
plain) (
tree)
|
|
# frozen_string_literal: true
require "cases/helper"
module ActiveModel
module Type
class DateTest < ActiveModel::TestCase
def test_type_cast_date
type = Type::Date.new
assert_nil type.cast(nil)
assert_nil type.cast("")
assert_nil type.cast(" ")
assert_nil type.cast("ABC")
date_string = ::Time.now.utc.strftime("%F")
assert_equal date_string, type.cast(date_string).strftime("%F")
end
end
end
end
|