mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 15:22:58 +00:00
added define_write_method with simple parse and cace for dates, times and datetimes when time zone conversion is off and default for Rails 2.0
This commit is contained in:
@@ -8,7 +8,7 @@ describe ValidatesTimeliness::AttributeMethods do
|
||||
@person = Person.new
|
||||
end
|
||||
|
||||
it "should call parser on write for time attribute" do
|
||||
it "should call parser on write for datetime attribute" do
|
||||
@person.class.should_receive(:parse_date_time).once
|
||||
@person.birth_date_and_time = "2000-06-01 02:03:04"
|
||||
end
|
||||
@@ -18,6 +18,11 @@ describe ValidatesTimeliness::AttributeMethods do
|
||||
@person.birth_date = "2000-06-01"
|
||||
end
|
||||
|
||||
it "should call parser on write for time attribute" do
|
||||
@person.class.should_receive(:parse_date_time).once
|
||||
@person.birth_time = "12:00"
|
||||
end
|
||||
|
||||
it "should return raw string value for attribute_before_type_cast when written as string" do
|
||||
time_string = "2000-06-01 02:03:04"
|
||||
@person.birth_date_and_time = time_string
|
||||
|
||||
Reference in New Issue
Block a user