c.should eq [@comic]
end
it '時系列で並んでいる' do
- v = Factory :visible_comic, :author_id => @author.id
+ v = Factory :visible_comic, :author_id => @author.id, :updated_at => Time.now + 100
c = Comic.list
c.should eq [v, @comic]
end
context 'DBに5件あって1ページの件数を2件に変えたとして' do
before do
- @comic2 = Factory :visible_comic, :author_id => @author.id
- @comic3 = Factory :editable_comic, :author_id => @author.id
- @comic4 = Factory :normal_comic, :author_id => @author.id
- @comic5 = Factory :editable_comic, :author_id => @author.id
+ @comic2 = Factory :visible_comic, :author_id => @author.id, :updated_at => Time.now + 100
+ @comic3 = Factory :editable_comic, :author_id => @author.id, :updated_at => Time.now + 200
+ @comic4 = Factory :normal_comic, :author_id => @author.id, :updated_at => Time.now + 300
+ @comic5 = Factory :editable_comic, :author_id => @author.id, :updated_at => Time.now + 400
Comic.stub(:default_page_size).and_return(2)
end
it '通常は2件を返す' do