Permalink
Browse files

handle new method name for rails 3.1.0 Time.find_zone!

  • Loading branch information...
1 parent 8c4b89c commit 3eb9a83aa74a34c6c5695b473e79ddaafdf6be8c @mjankowski mjankowski committed Sep 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 spec/datetime_spec.rb
View
@@ -44,15 +44,15 @@
end
it "should set the correct expected values for a #{column}_in_past method given a zone_default" do
- Time.zone_default = Time.__send__(:get_zone, "UTC")
+ Time.zone_default = Time.respond_to?(:find_zone!) ? Time.find_zone("UTC") : Time.__send__(:get_zone, "UTC")
now = DateTime.parse '2007-01-01'
Time.zone_default.stubs(:now).returns now
User.send(:"#{column}_in_past").should == [@abe, @bob]
Time.zone_default = nil
end
it "should set the correct expected values for a #{column}_in_future datetime column method given a zone_default" do
- Time.zone_default = Time.__send__(:get_zone, "UTC")
+ Time.zone_default = Time.respond_to?(:find_zone!) ? Time.find_zone("UTC") : Time.__send__(:get_zone, "UTC")
now = DateTime.parse '2007-01-01'
Time.zone_default.stubs(:now).returns now
User.send(:"#{column}_in_future").should == [@fox]

0 comments on commit 3eb9a83

Please sign in to comment.