Sha256: 449a2bb4b45830b83f5a03e5c38c5a7ab226ea1215416352d28f335118fbae80

Contents?: true

Size: 625 Bytes

Versions: 16

Compression:

Stored size: 625 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')
    expect(date.to_json).to eq("\"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')
    expect(date.as_json).to eq("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')
    expect(date.to_s).to eq("2009-01-01")
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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