Commit db469ea3 authored by randx's avatar randx

Fixing broken test of project last_activity

parent e0c43c46
...@@ -167,21 +167,19 @@ describe Project do ...@@ -167,21 +167,19 @@ describe Project do
end end
end end
describe "last_activity" do describe "last_activity methods" do
let(:project) { Factory :project } let(:project) { Factory :project }
let(:last_event) { double(created_at: Time.now) }
before do describe "last_activity" do
project.stub(last_event: double) it "should alias last_activity to last_event"do
project.stub(last_event: last_event)
project.last_activity.should == last_event
end end
it { project.last_activity.should == last_event }
end end
describe 'last_activity_date' do describe 'last_activity_date' do
let(:project) { Factory :project }
it 'returns the creation date of the project\'s last event if present' do it 'returns the creation date of the project\'s last event if present' do
last_event = double(created_at: Time.now)
project.stub(last_event: last_event) project.stub(last_event: last_event)
project.last_activity_date.should == last_event.created_at project.last_activity_date.should == last_event.created_at
end end
...@@ -190,6 +188,8 @@ describe Project do ...@@ -190,6 +188,8 @@ describe Project do
project.last_activity_date.should == project.updated_at project.last_activity_date.should == project.updated_at
end end
end end
end
describe "fresh commits" do describe "fresh commits" do
let(:project) { Factory :project } let(:project) { Factory :project }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment