Factory :admin
@user = Factory( :user_yas)
@author = @user.author
- @license = Factory :license
+ @sp = Factory :system_picture
+ @lg = Factory :license_group
+ @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
end
describe '検証に於いて' do
c.should eq [@artist]
end
it '時系列で並んでいる' do
- n = Factory :artist, :author_id => @author.id, :name => 'artist'
+ n = Factory :artist, :author_id => @author.id, :name => 'artist', :updated_at => Time.now + 100
l = Artist.list
l.should eq [n, @artist]
end
context 'DBに5件あって1ページの件数を2件に変えたとして' do
before do
- @artist2 = Factory :artist, :author_id => @author.id, :name => 'artist2'
- @artist3 = Factory :artist, :author_id => @author.id, :name => 'artist3'
- @artist4 = Factory :artist, :author_id => @author.id, :name => 'artist4'
- @artist5 = Factory :artist, :author_id => @author.id, :name => 'artist5'
+ @artist2 = Factory :artist, :author_id => @author.id, :name => 'artist2', :updated_at => Time.now + 100
+ @artist3 = Factory :artist, :author_id => @author.id, :name => 'artist3', :updated_at => Time.now + 200
+ @artist4 = Factory :artist, :author_id => @author.id, :name => 'artist4', :updated_at => Time.now + 300
+ @artist5 = Factory :artist, :author_id => @author.id, :name => 'artist5', :updated_at => Time.now + 400
Artist.stub(:default_page_size).and_return(2)
end
it '通常は2件を返す' do
@other_user = Factory( :user_yas)
@other_author = @other_user.author
@other_artist = Factory :artist_yas, :author_id => @other_author.id
- @license = Factory :license
+ @sp = Factory :system_picture
+ @lg = Factory :license_group
+ @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
end
describe '検証に於いて' do
pic.should eq [@op]
end
it '時系列で並んでいる' do
- newpic = Factory :original_picture, :artist_id => @artist.id
+ newpic = Factory :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 100
pic = OriginalPicture.list @artist.id
pic.should eq [newpic, @op]
end
context 'DBに5件あって1ページの件数を2件に変えたとして' do
before do
- @op2 = Factory :original_picture, :artist_id => @artist.id
- @op3 = Factory :original_picture, :artist_id => @artist.id
- @op4 = Factory :original_picture, :artist_id => @artist.id
- @op5 = Factory :original_picture, :artist_id => @artist.id
+ @op2 = Factory :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 100
+ @op3 = Factory :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 200
+ @op4 = Factory :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 300
+ @op5 = Factory :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 400
OriginalPicture.stub(:default_page_size).and_return(2)
end
it '通常は2件を返す' do
describe Panel do\r
before do\r
Factory :admin\r
- @license = Factory :license\r
+ @sp = Factory :system_picture
+ @lg = Factory :license_group
+ @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
@user = Factory( :user_yas)\r
@author = @user.author\r
@artist = Factory :artist_yas, :author_id => @author.id\r
pl.should eq [@panel]\r
end\r
it '時系列で並んでいる' do\r
- npl = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 1\r
+ npl = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 1, :updated_at => Time.now + 100\r
pl = Panel.list\r
pl.should eq [npl, @panel]\r
end\r
context 'DBに5件あって1ページの件数を2件に変えたとして' do\r
before do\r
- @npl2 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 1\r
- @npl3 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 2\r
- @npl4 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 3\r
- @npl5 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 4\r
+ @npl2 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 1, :updated_at => Time.now + 100\r
+ @npl3 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 2, :updated_at => Time.now + 200\r
+ @npl4 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 3, :updated_at => Time.now + 300\r
+ @npl5 = Factory :panel, :comic_id => @comic.id, :author_id => @author.id, :t => 4, :updated_at => Time.now + 400\r
Panel.stub(:default_page_size).and_return(2)\r
end\r
it '通常は2件を返す' do\r
@other_user = Factory( :user_yas)
@other_author = @other_user.author
@other_artist = Factory :artist_yas, :author_id => @other_author.id
- @license = Factory :license
+ @sp = Factory :system_picture
+ @lg = Factory :license_group
+ @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
@original_picture = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id\r
class Mgk ; class Image ; end ; end
end
it '時系列で並んでいる' do
nop = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id
- nrp = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop.id
+ nrp = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop.id, :updated_at => Time.now + 100
pic = ResourcePicture.list
pic.should eq [nrp, @rp]
end
context 'DBに5件あって1ページの件数を2件に変えたとして' do
before do
nop2 = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id
- @nrp2 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop2.id
+ @nrp2 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop2.id, :updated_at => Time.now + 100
nop3 = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id
- @nrp3 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop3.id
+ @nrp3 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop3.id, :updated_at => Time.now + 200
nop4 = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id
- @nrp4 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop4.id
+ @nrp4 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop4.id, :updated_at => Time.now + 300
nop5 = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id
- @nrp5 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop5.id
+ @nrp5 = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => nop5.id, :updated_at => Time.now + 400
ResourcePicture.stub(:default_page_size).and_return(2)
end
it '通常は2件を返す' do