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-1.4.0 spec/unit/date_spec.rb
couch_potato-1.3.0 spec/unit/date_spec.rb
couch_potato-1.2.0 spec/unit/date_spec.rb
couch_potato-1.1.4 spec/unit/date_spec.rb
couch_potato-1.1.2 spec/unit/date_spec.rb
couch_potato-1.1.1 spec/unit/date_spec.rb
couch_potato-1.1.0 spec/unit/date_spec.rb
couch_potato-1.0.1 spec/unit/date_spec.rb
couch_potato-1.0.0 spec/unit/date_spec.rb
couch_potato-0.7.1 spec/unit/date_spec.rb
couch_potato-0.7.0 spec/unit/date_spec.rb
couch_potato-0.7.0.pre.1 spec/unit/date_spec.rb
couch_potato-0.6.0 spec/unit/date_spec.rb
couch_potato-0.5.7 spec/unit/date_spec.rb
couch_potato-rails2-0.5.10 spec/unit/date_spec.rb
couch_potato-rails2-0.5.9 spec/unit/date_spec.rb
couch_potato-rails2-0.5.8 spec/unit/date_spec.rb
couch_potato-rails2-0.5.7 spec/unit/date_spec.rb
couch_potato-rails2-0.5.6 spec/unit/date_spec.rb
couch_potato-0.5.6 spec/unit/date_spec.rb