fix project.last_activity spec
This commit is contained in:
parent
cd3d50caf2
commit
d246a68a24
2 changed files with 2 additions and 2 deletions
|
@ -158,7 +158,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_activity
|
def last_activity
|
||||||
events.order("created_at DESC").first || nil
|
events.order("created_at ASC").last
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_activity_date
|
def last_activity_date
|
||||||
|
|
|
@ -141,7 +141,7 @@ describe Project do
|
||||||
let(:last_event) { double }
|
let(:last_event) { double }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
project.stub(:events).and_return( [ double, double, last_event ] )
|
project.stub_chain(:events, :order).and_return( [ double, double, last_event ] )
|
||||||
end
|
end
|
||||||
|
|
||||||
it { project.last_activity.should == last_event }
|
it { project.last_activity.should == last_event }
|
||||||
|
|
Loading…
Add table
Reference in a new issue