Merge pull request #99 from softace/fixing_build

Fix for running tests in non-Australian timezones
This commit is contained in:
Adam Meehan 2013-06-16 15:22:33 -07:00
commit 00ce472d3e
3 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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