铁路面积为3.0米,其次为:
class DrawingList < ActiveRecord::Base
scope :active_drawings, where( start_date <= ? AND end_date >= ? , Date.today, Date.today)
end
我认为,我要做的是:
before do
@list = DrawingList.create #things that include begin and end dates
end
it "doesn t find an active drawing if they are out of range" do
pending "really need to figure out how to work timecop in the presence of scopes"
Timecop.travel(2.days)
puts Date.today.to_s
DrawingList.active_drawings.first.should be_nil
end
如你所想象的那样,这些说法确实表明这一日期。 今天是两天。 然而,范围在不同的背景下进行评估,因此使用了旧的“日常”。 今天如何在时间范围可能产生影响的背景下进行评估。
感谢!