提交 d246a68a 编写于 作者: R randx

fix project.last_activity spec

上级 cd3d50ca
......@@ -158,7 +158,7 @@ class Project < ActiveRecord::Base
end
def last_activity
events.order("created_at DESC").first || nil
events.order("created_at ASC").last
end
def last_activity_date
......
......@@ -141,7 +141,7 @@ describe Project do
let(:last_event) { double }
before do
project.stub(:events).and_return( [ double, double, last_event ] )
project.stub_chain(:events, :order).and_return( [ double, double, last_event ] )
end
it { project.last_activity.should == last_event }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册