mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
fix last refactor so it casts Date object to time if attribute is datetime or time with spec added
This commit is contained in:
@@ -69,6 +69,11 @@ describe ValidatesTimeliness::ActiveRecord::AttributeMethods do
|
||||
@person.birth_date_and_time.should be_kind_of(Time)
|
||||
end
|
||||
|
||||
it "should return Time object for datetime attribute read method when assigned Date object" do
|
||||
@person.birth_date_and_time = Date.today
|
||||
@person.birth_date_and_time.should be_kind_of(Time)
|
||||
end
|
||||
|
||||
it "should return Time object for datetime attribute read method when assigned string" do
|
||||
@person.birth_date_and_time = "2000-01-01 02:03:04"
|
||||
@person.birth_date_and_time.should be_kind_of(Time)
|
||||
|
||||
Reference in New Issue
Block a user