before_filter :authenticate_admin!, :only => [:list, :browse]
def top
- @new_comics = Comic.find(:all,
- :include => :author, :conditions => ['visible > 0'], :order => 'updated_at desc', :limit => 5
- )
- @new_pictures = OriginalPicture.list @artist.id
-
respond_to do |format|
format.html # index.html.erb
end
@artist3 = FactoryGirl.create :artist, :author_id => @author.id, :name => 'artist3', :created_at => Time.now + 200
@artist4 = FactoryGirl.create :artist, :author_id => @author.id, :name => 'artist4', :created_at => Time.now + 300
@artist5 = FactoryGirl.create :artist, :author_id => @author.id, :name => 'artist5', :created_at => Time.now + 400
- Artist.stub(:default_page_size).and_return(0)
+ Artist.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
- r = Artist.list
+ r = Artist.list 5, 0
r.should have(5).items
end
end
@author5 = @other_user5.author
@author5.created_at = Time.now + 400
@author5.save
- Author.stub(:default_page_size).and_return(0)
+ Author.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
- r = Author.list
+ r = Author.list 5, 0
r.should have(5).items
end
end
@color3 = FactoryGirl.create :color, :name => 'new color b', :t => 2
@color4 = FactoryGirl.create :color, :name => 'new color c', :t => 3
@color5 = FactoryGirl.create :color, :name => 'new color d', :t => 4
- Color.stub(:default_page_size).and_return(0)
+ Color.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
- r = Color.list
+ r = Color.list 5, 0
r.should have(5).items
end
end
@comic3 = FactoryGirl.create :comic, :author_id => @author.id, :updated_at => Time.now + 200
@comic4 = FactoryGirl.create :comic, :author_id => @author.id, :updated_at => Time.now + 300
@comic5 = FactoryGirl.create :comic, :author_id => @author.id, :updated_at => Time.now + 400
- Comic.stub(:default_page_size).and_return(2)
+ Author.stub(:default_comic_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = Comic.mylist @author, 5, 0
@gc3 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 2, :color_id => @color.id, :updated_at => Time.now + 200
@gc4 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 3, :color_id => @color.id, :updated_at => Time.now + 300
@gc5 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 4, :color_id => @color.id, :updated_at => Time.now + 400
+ GroundColor.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
r = GroundColor.list 5, 0
@gc3 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 2, :color_id => @color.id, :updated_at => Time.now + 200
@gc4 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 3, :color_id => @color.id, :updated_at => Time.now + 300
@gc5 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 4, :color_id => @color.id, :updated_at => Time.now + 400
+ Author.stub(:default_ground_color_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = GroundColor.mylist @author, 5, 0
@gp3 = FactoryGirl.create :ground_picture, :panel_id => @panel.id, :z => 2, :picture_id => @p.id, :updated_at => Time.now + 200
@gp4 = FactoryGirl.create :ground_picture, :panel_id => @panel.id, :z => 3, :picture_id => @p.id, :updated_at => Time.now + 300
@gp5 = FactoryGirl.create :ground_picture, :panel_id => @panel.id, :z => 4, :picture_id => @p.id, :updated_at => Time.now + 400
+ GroundPicture.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
r = GroundPicture.list 5, 0
@gp3 = FactoryGirl.create :ground_picture, :panel_id => @panel.id, :z => 2, :picture_id => @p.id, :updated_at => Time.now + 200
@gp4 = FactoryGirl.create :ground_picture, :panel_id => @panel.id, :z => 3, :picture_id => @p.id, :updated_at => Time.now + 300
@gp5 = FactoryGirl.create :ground_picture, :panel_id => @panel.id, :z => 4, :picture_id => @p.id, :updated_at => Time.now + 400
+ Author.stub(:default_ground_picture_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = GroundPicture.mylist @author, 5, 0
@op3 = FactoryGirl.create :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 200
@op4 = FactoryGirl.create :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 300
@op5 = FactoryGirl.create :original_picture, :artist_id => @artist.id, :updated_at => Time.now + 400
+ OriginalPicture.stub(:default_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = OriginalPicture.mylist @artist, 5, 0
@pc3 = FactoryGirl.create :panel_color, :panel_id => @panel.id, :z => 2, :updated_at => Time.now + 200
@pc4 = FactoryGirl.create :panel_color, :panel_id => @panel.id, :z => 3, :updated_at => Time.now + 300
@pc5 = FactoryGirl.create :panel_color, :panel_id => @panel.id, :z => 4, :updated_at => Time.now + 400
+ PanelColor.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
r = PanelColor.list 5, 0
@pc3 = FactoryGirl.create :panel_color, :panel_id => @panel.id, :z => 2, :updated_at => Time.now + 200
@pc4 = FactoryGirl.create :panel_color, :panel_id => @panel.id, :z => 3, :updated_at => Time.now + 300
@pc5 = FactoryGirl.create :panel_color, :panel_id => @panel.id, :z => 4, :updated_at => Time.now + 400
+ Author.stub(:default_panel_color_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = PanelColor.mylist @author, 5, 0
:width => @p.width, :height => @p.height, :updated_at => Time.now + 300
@npl5 = FactoryGirl.create :panel_picture, :panel_id => @panel.id, :t => 4, :picture_id => @p.id,
:width => @p.width, :height => @p.height, :updated_at => Time.now + 400
+ PanelPicture.stub(:default_page_size).and_return(2)
end
it '通常は全件(5件)を返す' do
r = PanelPicture.list 5, 0
:width => @p.width, :height => @p.height, :updated_at => Time.now + 300
@npl5 = FactoryGirl.create :panel_picture, :panel_id => @panel.id, :t => 4, :picture_id => @p.id,
:width => @p.width, :height => @p.height, :updated_at => Time.now + 400
+ Author.stub(:default_panel_picture_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = PanelPicture.mylist @author, 5, 0
@npl3 = FactoryGirl.create :panel, :author_id => @author.id, :updated_at => Time.now + 200\r
@npl4 = FactoryGirl.create :panel, :author_id => @author.id, :updated_at => Time.now + 300\r
@npl5 = FactoryGirl.create :panel, :author_id => @author.id, :updated_at => Time.now + 400\r
- Panel.stub(:default_page_size).and_return(2)\r
+ Author.stub(:default_panel_page_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = Panel.mylist @author, 5, 0
@story3 = FactoryGirl.create :story, :author_id => @author.id, :comic_id => @comic.id, :panel_id => @panel.id, :t => 2, :updated_at => Time.now + 200
@story4 = FactoryGirl.create :story, :author_id => @author.id, :comic_id => @comic.id, :panel_id => @panel.id, :t => 3, :updated_at => Time.now + 300
@story5 = FactoryGirl.create :story, :author_id => @author.id, :comic_id => @comic.id, :panel_id => @panel.id, :t => 4, :updated_at => Time.now + 400
+ Author.stub(:default_story_size).and_return(2)\r
end
it '通常は全件(5件)を返す' do
r = Story.mylist @author, 5, 0