spec/timespan/mongoid/mongoid_timespan_spec.rb in timespan-0.2.5 vs spec/timespan/mongoid/mongoid_timespan_spec.rb in timespan-0.2.6

- old
+ new

@@ -16,9 +16,20 @@ DateTime.parse(subject.period.start_date.to_s).strftime('%d %b %Y').should == Date.today.strftime('%d %b %Y') end end end + context '2 days duration using integer' do + let(:account) do + Account.create :period => {:duration => 2.days } + end + + describe '.start_date' do + it 'should default to today' do + DateTime.parse(subject.period.start_date.to_s).strftime('%d %b %Y').should == Date.today.strftime('%d %b %Y') + end + end + end context '2 days duration (from now - default)' do let(:account) do Account.create :period => {:duration => '2 days'} end \ No newline at end of file