Skip to content

Instantly share code, notes, and snippets.

@senny
Created October 25, 2013 11:33
Show Gist options
  • Save senny/7153270 to your computer and use it in GitHub Desktop.
Save senny/7153270 to your computer and use it in GitHub Desktop.
def test_timestamp_with_zone_values_without_rails_time_zone_support
p @connection.execute('SHOW TIME ZONE', 'SCHEMA').first["TimeZone"]
with_timezone_config default: :local, aware_attributes: false do
@connection.reconnect!
@connection.execute("SET time zone 'America/Jamaica'", 'SCHEMA')
@first_timestamp_with_zone = PostgresqlTimestampWithZone.find(1)
assert_equal Time.utc(2010,1,1, 11,0,0), @first_timestamp_with_zone.time
assert_instance_of Time, @first_timestamp_with_zone.time
p @connection.execute('SHOW TIME ZONE', 'SCHEMA').first["TimeZone"]
end
ensure
@connection.reconnect!
p @connection.execute('SHOW TIME ZONE', 'SCHEMA').first["TimeZone"]
end
@senny
Copy link
Author

senny commented Oct 25, 2013

"UTC"
"America/Jamaica"
"UTC"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment