Sha256: e42abc6df2678842e818318c6c3db674f5c59e10ff72c865393bd21887112fa7

Contents?: true

Size: 457 Bytes

Versions: 3

Compression:

Stored size: 457 Bytes

Contents

require File.join(File.dirname(__FILE__), "/../../../../spec_helper.rb")

describe Mongoid::Extensions::Date::Conversions do

  describe "#cast" do

    context "when string provided" do

      it "parses the string" do
        Date.cast("1976/11/19").should == Date.new(1976, 11, 19)
      end

    end

    context "when time provided" do

      it "parses the time" do
        Date.cast(30.seconds.ago).should == Date.today
      end

    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-0.5.5 spec/unit/mongoid/extensions/date/conversions_spec.rb
mongoid-0.5.4 spec/unit/mongoid/extensions/date/conversions_spec.rb
mongoid-0.5.3 spec/unit/mongoid/extensions/date/conversions_spec.rb