Skip to content

Instantly share code, notes, and snippets.

@rubystar
Created June 26, 2012 12:50
Show Gist options
  • Save rubystar/2995630 to your computer and use it in GitHub Desktop.
Save rubystar/2995630 to your computer and use it in GitHub Desktop.
spec/models/ad_spec.rb
context "when sd is today" do
it "should set start_date appropriately" do
@ad.start_date = Date.today
@ad.start_date.to_s.should == DateTime.parse("Wed, 15 Sep 2010 13:15:00 -0500").in_time_zone.to_s
end
end
context "when sd is tomorrow" do
it "should set start_date appropriately" do
@ad.start_date = Date.tomorrow
@ad.start_date.to_s.should == DateTime.parse("Thu, 16 Sep 2010 00:00:00 -0500").in_time_zone.to_s
end
end
.........
context "when ed is today" do
it "should set end_date appropriately" do
@ad.end_date = Date.today
@ad.end_date.to_s.should == DateTime.parse("Wed, 15 Sep 2010 23:59:59 -0500").in_time_zone.to_s
end
end
context "when ed is tomorrow" do
it "should set end_date appropriately" do
@ad.end_date = Date.tomorrow
@ad.end_date.to_s.should == DateTime.parse("Thu, 16 Sep 2010 23:59:59 -0500").in_time_zone.to_s
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment