Commit db469ea3e69f03f5c1966958041bca91a04686ce
1 parent
e0c43c46
Exists in
master
and in
4 other branches
Fixing broken test of project last_activity
Showing
1 changed file
with
16 additions
and
16 deletions
Show diff stats
spec/models/project_spec.rb
@@ -167,29 +167,29 @@ describe Project do | @@ -167,29 +167,29 @@ describe Project do | ||
167 | end | 167 | end |
168 | end | 168 | end |
169 | 169 | ||
170 | - describe "last_activity" do | 170 | + describe "last_activity methods" do |
171 | let(:project) { Factory :project } | 171 | let(:project) { Factory :project } |
172 | + let(:last_event) { double(created_at: Time.now) } | ||
172 | 173 | ||
173 | - before do | ||
174 | - project.stub(last_event: double) | 174 | + describe "last_activity" do |
175 | + it "should alias last_activity to last_event"do | ||
176 | + project.stub(last_event: last_event) | ||
177 | + project.last_activity.should == last_event | ||
178 | + end | ||
175 | end | 179 | end |
176 | 180 | ||
177 | - it { project.last_activity.should == last_event } | ||
178 | - end | ||
179 | - | ||
180 | - describe 'last_activity_date' do | ||
181 | - let(:project) { Factory :project } | ||
182 | - | ||
183 | - it 'returns the creation date of the project\'s last event if present' do | ||
184 | - last_event = double(created_at: Time.now) | ||
185 | - project.stub(last_event: last_event) | ||
186 | - project.last_activity_date.should == last_event.created_at | ||
187 | - end | 181 | + describe 'last_activity_date' do |
182 | + it 'returns the creation date of the project\'s last event if present' do | ||
183 | + project.stub(last_event: last_event) | ||
184 | + project.last_activity_date.should == last_event.created_at | ||
185 | + end | ||
188 | 186 | ||
189 | - it 'returns the project\'s last update date if it has no events' do | ||
190 | - project.last_activity_date.should == project.updated_at | 187 | + it 'returns the project\'s last update date if it has no events' do |
188 | + project.last_activity_date.should == project.updated_at | ||
189 | + end | ||
191 | end | 190 | end |
192 | end | 191 | end |
192 | + | ||
193 | describe "fresh commits" do | 193 | describe "fresh commits" do |
194 | let(:project) { Factory :project } | 194 | let(:project) { Factory :project } |
195 | 195 |