diff --git a/spec/validates_timeliness/conversion_spec.rb b/spec/validates_timeliness/conversion_spec.rb index 88eb693..fb03b70 100644 --- a/spec/validates_timeliness/conversion_spec.rb +++ b/spec/validates_timeliness/conversion_spec.rb @@ -52,7 +52,7 @@ describe ValidatesTimeliness::Conversion do describe "for datetime type" do it "should return Date as Time value" do - type_cast_value(Date.new(2010, 1, 1), :datetime).should == Time.local_time(2010, 1, 1, 0, 0, 0) + type_cast_value(Date.new(2010, 1, 1), :datetime).should == Time.local(2010, 1, 1, 0, 0, 0) end it "should return same Time value" do diff --git a/spec/validates_timeliness/validator/after_spec.rb b/spec/validates_timeliness/validator/after_spec.rb index e7506de..995b2a6 100644 --- a/spec/validates_timeliness/validator/after_spec.rb +++ b/spec/validates_timeliness/validator/after_spec.rb @@ -25,15 +25,15 @@ describe ValidatesTimeliness::Validator, ":after option" do end it "should not be valid for same time as restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 12, 0, 0), 'must be after 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 12, 0, 0), 'must be after 12:00:00') end it "should not be valid for time before restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 11, 59, 59), 'must be after 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 11, 59, 59), 'must be after 12:00:00') end it "should be valid for time after restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 12, 00, 01)) + valid!(:birth_time, Time.local(2000, 1, 1, 12, 00, 01)) end end diff --git a/spec/validates_timeliness/validator/before_spec.rb b/spec/validates_timeliness/validator/before_spec.rb index 5007675..5d81a9c 100644 --- a/spec/validates_timeliness/validator/before_spec.rb +++ b/spec/validates_timeliness/validator/before_spec.rb @@ -25,15 +25,15 @@ describe ValidatesTimeliness::Validator, ":before option" do end it "should not be valid for time after restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 12, 00, 01), 'must be before 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 12, 00, 01), 'must be before 12:00:00') end it "should not be valid for same time as restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 12, 0, 0), 'must be before 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 12, 0, 0), 'must be before 12:00:00') end it "should be valid for time before restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 11, 59, 59)) + valid!(:birth_time, Time.local(2000, 1, 1, 11, 59, 59)) end end diff --git a/spec/validates_timeliness/validator/is_at_spec.rb b/spec/validates_timeliness/validator/is_at_spec.rb index 24e7c8f..14532b4 100644 --- a/spec/validates_timeliness/validator/is_at_spec.rb +++ b/spec/validates_timeliness/validator/is_at_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe ValidatesTimeliness::Validator, ":is_at option" do before do - Timecop.freeze(Time.local_time(2010, 1, 1, 0, 0, 0)) + Timecop.freeze(Time.local(2010, 1, 1, 0, 0, 0)) end describe "for date type" do @@ -29,15 +29,15 @@ describe ValidatesTimeliness::Validator, ":is_at option" do end it "should not be valid for time before restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 11, 59, 59), 'must be at 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 11, 59, 59), 'must be at 12:00:00') end it "should not be valid for time after restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 12, 00, 01), 'must be at 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 12, 00, 01), 'must be at 12:00:00') end it "should be valid for same time as restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 12, 0, 0)) + valid!(:birth_time, Time.local(2000, 1, 1, 12, 0, 0)) end end diff --git a/spec/validates_timeliness/validator/on_or_after_spec.rb b/spec/validates_timeliness/validator/on_or_after_spec.rb index 68c91da..82eeb99 100644 --- a/spec/validates_timeliness/validator/on_or_after_spec.rb +++ b/spec/validates_timeliness/validator/on_or_after_spec.rb @@ -25,15 +25,15 @@ describe ValidatesTimeliness::Validator, ":on_or_after option" do end it "should not be valid for time before restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 11, 59, 59), 'must be on or after 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 11, 59, 59), 'must be on or after 12:00:00') end it "should be valid for time after restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 12, 00, 01)) + valid!(:birth_time, Time.local(2000, 1, 1, 12, 00, 01)) end it "should be valid for same time as restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 12, 0, 0)) + valid!(:birth_time, Time.local(2000, 1, 1, 12, 0, 0)) end end diff --git a/spec/validates_timeliness/validator/on_or_before_spec.rb b/spec/validates_timeliness/validator/on_or_before_spec.rb index e238aeb..0341d9f 100644 --- a/spec/validates_timeliness/validator/on_or_before_spec.rb +++ b/spec/validates_timeliness/validator/on_or_before_spec.rb @@ -25,15 +25,15 @@ describe ValidatesTimeliness::Validator, ":on_or_before option" do end it "should not be valid for time after restriction" do - invalid!(:birth_time, Time.local_time(2000, 1, 1, 12, 00, 01), 'must be on or before 12:00:00') + invalid!(:birth_time, Time.local(2000, 1, 1, 12, 00, 01), 'must be on or before 12:00:00') end it "should be valid for time before restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 11, 59, 59)) + valid!(:birth_time, Time.local(2000, 1, 1, 11, 59, 59)) end it "should be valid for same time as restriction" do - valid!(:birth_time, Time.local_time(2000, 1, 1, 12, 0, 0)) + valid!(:birth_time, Time.local(2000, 1, 1, 12, 0, 0)) end end diff --git a/spec/validates_timeliness/validator_spec.rb b/spec/validates_timeliness/validator_spec.rb index 6d03ba1..0731dd4 100644 --- a/spec/validates_timeliness/validator_spec.rb +++ b/spec/validates_timeliness/validator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe ValidatesTimeliness::Validator do before do - Timecop.freeze(Time.local_time(2010, 1, 1, 0, 0, 0)) + Timecop.freeze(Time.local(2010, 1, 1, 0, 0, 0)) end describe "Model.validates with :timeliness option" do