Add latest added tracks list on the home page

This commit is contained in:
Thibault Jouan
2011-07-27 21:42:33 +00:00
parent b39bc2d6da
commit 46abe07268
8 changed files with 46 additions and 0 deletions

View File

@@ -7,5 +7,12 @@ describe HomeController do
get :index
assigns[:playlists].should == [playlist]
end
it 'assigns latest tracks as @tracks' do
track1 = Factory.create(:track, :created_at => '2011-07-27 19:13:42')
track2 = Factory.create(:track, :created_at => '2011-07-27 19:58:57')
get :index
assigns[:tracks].should == Track.latest
end
end
end