Sha256: 33746808ce9f410479e6309d85c5c187bef5ca77873ece72c8420a0a981eb378

Contents?: true

Size: 610 Bytes

Versions: 28

Compression:

Stored size: 610 Bytes

Contents

require 'spec_helper'

describe Date, 'to_json' do
  it "should format the date in a way that i can use it for sorting in couchdb" do
    date = Date.parse('2009-01-01')
    date.to_json.should == "\"2009/01/01\""
  end
end

describe Date, 'as_json' do
  it "should format it in the same way as to_json does so i can use this to do queries over date attributes" do
    date = Date.parse('2009-01-01')
    date.as_json.should == "2009/01/01"
  end
end

describe Date, 'to_s' do
  it "should leave the original to_s untouched" do
    date = Date.parse('2009-01-01')
    date.to_s.should == "2009-01-01"
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
couch_potato-0.5.5 spec/unit/date_spec.rb
couch_potato-0.5.4 spec/unit/date_spec.rb
couch_potato-0.5.3 spec/unit/date_spec.rb
couch_potato-0.5.2 spec/unit/date_spec.rb
couch_potato-0.5.1 spec/unit/date_spec.rb
couch_potato-0.5.0 spec/unit/date_spec.rb
davber_couch_potato-0.4.0 spec/unit/date_spec.rb
couch_potato-0.4.0 spec/unit/date_spec.rb