mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +00:00
added make_time examples
This commit is contained in:
parent
75f3ef34e8
commit
e2790538a8
@ -45,4 +45,26 @@ describe ValidatesTimeliness::ValidationMethods do
|
||||
ActiveRecord::Base.parse_date_time(*args)
|
||||
end
|
||||
end
|
||||
|
||||
describe "make_time" do
|
||||
|
||||
if RAILS_VER >= '2.1'
|
||||
|
||||
it "should create time using current timezone" do
|
||||
Time.zone = 'Melbourne'
|
||||
time = ActiveRecord::Base.send(:make_time, [2000,1,1,12,0,0])
|
||||
time.zone.should == "EST"
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
it "should create time using default timezone" do
|
||||
time = ActiveRecord::Base.send(:make_time, [2000,1,1,12,0,0])
|
||||
time.zone.should == "UTC"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user