Sha256: 2af5e45aa71151bb8061f202492eaae84844174a26ae5987e8eb7457bd21c6a8

Contents?: true

Size: 540 Bytes

Versions: 17

Compression:

Stored size: 540 Bytes

Contents

require 'spec_helper'

describe Time, 'to_json' do
  it "should convert to utc and format the time in a way that i can use it for sorting in couchdb" do
    time = Time.parse('2009-01-01 11:12:23 +0200')
    expect(time.to_json).to eq("\"2009/01/01 09:12:23 +0000\"")
  end
end

describe Time, 'as_json' do
  it "should format it in the same way as to_json does so i can use this to do queries over time attributes" do
    time = Time.parse('2009-01-01 11:12:23 +0200')
    expect(time.as_json).to eq("2009/01/01 09:12:23 +0000")
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
couch_potato-1.18.0 spec/unit/time_spec.rb
couch_potato-1.17.0 spec/unit/time_spec.rb
couch_potato-1.16.0 spec/unit/time_spec.rb
couch_potato-1.15.0 spec/unit/time_spec.rb
couch_potato-1.14.0 spec/unit/time_spec.rb
couch_potato-1.13.0 spec/unit/time_spec.rb
couch_potato-1.12.1 spec/unit/time_spec.rb
couch_potato-1.12.0 spec/unit/time_spec.rb
couch_potato-1.11.0 spec/unit/time_spec.rb
couch_potato-1.10.1 spec/unit/time_spec.rb
couch_potato-1.10.0 spec/unit/time_spec.rb
couch_potato-1.9.0 spec/unit/time_spec.rb
couch_potato-1.7.1 spec/unit/time_spec.rb
couch_potato-1.7.0 spec/unit/time_spec.rb
couch_potato-1.6.5 spec/unit/time_spec.rb
couch_potato-1.6.4 spec/unit/time_spec.rb
couch_potato-1.6.3 spec/unit/time_spec.rb