spec/query_presenter_spec.rb in oculus-0.5.0 vs spec/query_presenter_spec.rb in oculus-0.8.0
- old
+ new
@@ -8,12 +8,23 @@
it "should delegate to the underlying query" do
query.name = 'foo'
presenter.description.should == 'foo'
end
- it "has a formatted date" do
- query.date = Time.mktime(2010, 1, 1, 12, 34)
- presenter.formatted_date.should == '2010-01-01 12:34'
+ it "has a formatted start time" do
+ query.started_at = Time.mktime(2010, 1, 1, 12, 34)
+ presenter.formatted_start_time.should == '2010-01-01 12:34 PM'
+ end
+
+ it "has a formatted finish time" do
+ query.finished_at = Time.mktime(2010, 1, 1, 12, 34)
+ presenter.formatted_finish_time.should == '2010-01-01 12:34 PM'
+ end
+
+ it "has an elapsed time" do
+ query.started_at = Time.mktime(2010, 1, 1, 10, 30)
+ query.finished_at = Time.mktime(2010, 1, 1, 12, 34)
+ presenter.elapsed_time.should == '2 hours 4 minutes'
end
it "reports successful queries" do
query.stub(:complete?).and_return(true)
presenter.status.should == 'done'