Skip to content

Instantly share code, notes, and snippets.

@BJClark
Created March 1, 2010 22:04
Show Gist options
  • Save BJClark/318866 to your computer and use it in GitHub Desktop.
Save BJClark/318866 to your computer and use it in GitHub Desktop.
it "should return contest_ends_at in the proper time zone" do
e = Factory(:event)
e.contest_ends_at.utc_oftset.should == Time.zone.utc_offset
end
NoMethodError: undefined method `utc_oftset' for Mon Mar 01 15:59:59 UTC 2010:Time
#in the console
>> e.contest_ends_at.utc_offset == Time.zone.utc_offset
=> true
>> e.contest_ends_at.zone
=> "PST"
>> e.contest_ends_at.class
=> ActiveSupport::TimeWithZone
>> Time.zone.name
=> "Pacific Time (US & Canada)"
>> Time.zone.now.zone
=> "PST"
>> Time.zone.abbreviation
NoMethodError: undefined method `abbreviation' for #<ActiveSupport::TimeZone:0x101e20c28>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment