mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
Merge pull request #99 from softace/fixing_build
Fix for running tests in non-Australian timezones
This commit is contained in:
commit
00ce472d3e
@ -57,6 +57,7 @@ class PersonWithShim < Person
|
||||
include TestModelShim
|
||||
end
|
||||
|
||||
ActiveRecord::Base.default_timezone = :utc
|
||||
ActiveRecord::Base.time_zone_aware_attributes = true
|
||||
ActiveRecord::Base.establish_connection({:adapter => 'sqlite3', :database => ':memory:'})
|
||||
ActiveRecord::Migration.verbose = false
|
||||
|
||||
@ -10,7 +10,7 @@ describe ValidatesTimeliness::Extensions::MultiparameterHandler do
|
||||
|
||||
it 'should assign a Time value for valid datetimes' do
|
||||
employee = record_with_multiparameter_attribute(:birth_datetime, [2000, 2, 28, 12, 0, 0])
|
||||
employee.birth_datetime_before_type_cast.should eq Time.local(2000, 2, 28, 12, 0, 0)
|
||||
employee.birth_datetime_before_type_cast.should eq Time.zone.local(2000, 2, 28, 12, 0, 0)
|
||||
end
|
||||
|
||||
it 'should assign a string value for incomplete time' do
|
||||
|
||||
@ -221,7 +221,7 @@ describe ValidatesTimeliness, 'ActiveRecord' do
|
||||
Employee.create(:birth_datetime => datetime)
|
||||
|
||||
record = Employee.last
|
||||
record.birth_datetime_before_type_cast.should match(/2010-01-01 00:00:00/)
|
||||
record.birth_datetime_before_type_cast.should match(/#{datetime.utc.to_s[0...-4]}/)
|
||||
end
|
||||
|
||||
context "with plugin parser" do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user