Sha256: 2e14dd3173b204d3121d2662ec448c4139c8f7f4e8a44e24088e31d24b4a2e72

Contents?: true

Size: 530 Bytes

Versions: 26

Compression:

Stored size: 530 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')
    time.to_json.should == "\"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')
    time.as_json.should == "2009/01/01 09:12:23 +0000"
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
couch_potato-1.4.0 spec/unit/time_spec.rb
couch_potato-1.3.0 spec/unit/time_spec.rb
couch_potato-1.2.0 spec/unit/time_spec.rb
couch_potato-1.1.4 spec/unit/time_spec.rb
couch_potato-1.1.2 spec/unit/time_spec.rb
couch_potato-1.1.1 spec/unit/time_spec.rb
couch_potato-1.1.0 spec/unit/time_spec.rb
couch_potato-1.0.1 spec/unit/time_spec.rb
couch_potato-1.0.0 spec/unit/time_spec.rb
couch_potato-0.7.1 spec/unit/time_spec.rb
couch_potato-0.7.0 spec/unit/time_spec.rb
couch_potato-0.7.0.pre.1 spec/unit/time_spec.rb
couch_potato-0.6.0 spec/unit/time_spec.rb
couch_potato-0.5.7 spec/unit/time_spec.rb
couch_potato-rails2-0.5.10 spec/unit/time_spec.rb
couch_potato-rails2-0.5.9 spec/unit/time_spec.rb
couch_potato-rails2-0.5.8 spec/unit/time_spec.rb
couch_potato-rails2-0.5.7 spec/unit/time_spec.rb
couch_potato-rails2-0.5.6 spec/unit/time_spec.rb
couch_potato-0.5.6 spec/unit/time_spec.rb