Sha256: 0dc3af13af432b8e70ea8fe83061bd00bd2cbd68bc1d00a6156ceadf9378ce41

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

require 'timespan/mongoid/spec_helper'

describe Timespan do
	subject { account }

  let(:from) { Chronic.parse("1 day ago") }
  let(:to)   { Time.now }

  context '2 days duration (from now - default)' do
    let(:account) do 
      Account.create :period => {:duration => '2 days', :from => Date.today }
    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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
timespan-0.2.3 spec/timespan/mongoid/mongoid_timespan_spec.rb
timespan-0.2.2 spec/timespan/mongoid/mongoid_timespan_spec.rb
timespan-0.2.1 spec/timespan/mongoid/mongoid_timespan_spec.rb