Skip to content

Instantly share code, notes, and snippets.

@elight
Created July 13, 2011 23:26
Show Gist options
  • Save elight/1081573 to your computer and use it in GitHub Desktop.
Save elight/1081573 to your computer and use it in GitHub Desktop.
def test_cache_key_for_existing_record_is_not_timezone_dependent
p Time.zone
Time.zone = "UTC"
p Time.zone
p Developer.find(1)
utc_key = Developer.find(1).cache_key
p utc_key
ActiveRecord::Base.connection.clear_query_cache
Time.zone = "EST"
p Time.zone
est_key = Developer.find(1).cache_key
p est_key
assert_equal utc_key, est_key
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment