Sha256: 0e58db6ff2de329c07a8e527a571ee5fdc3e430257b346503e85df20bd8a8fff

Contents?: true

Size: 731 Bytes

Versions: 4

Compression:

Stored size: 731 Bytes

Contents

describe "Time", ->
  beforeEach ->
    # fake a 10 seconds offset
    Time.tz_offset = 10
  
  
  it "can convert Time From UTC to local", ->
    time = 100
    utc_time = Time.utc_to_local(time)
    expect(utc_time).toEqual( 110 )
  
  it "can convert Time From local to UTC", ->
    time = 100
    utc_time = Time.local_to_utc(time)
    expect(utc_time).toEqual( 90 )
  
  it "can convert Client timestamp to Server timestamp", ->
    client_time = 100 * 1000
    server_time = Time.client_to_server(client_time)
    expect(server_time).toEqual(90)

  it "can convert Server timestamp to Client timestamp", ->
    server_time = 90
    client_time = Time.server_to_client(server_time)
    expect(client_time).toEqual(100 * 1000)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rrd-grapher-1.0.3 spec/javascripts/source/time_spec.coffee
rrd-grapher-1.0.2 spec/javascripts/source/time_spec.coffee
rrd-grapher-1.0.1 spec/javascripts/source/time_spec.coffee
rrd-grapher-1.0.0 spec/javascripts/source/time_spec.coffee