From: yasushiito Date: Sat, 29 Sep 2012 08:31:34 +0000 (+0900) Subject: t#29510: X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0e63503fd71ce3b6295bbef22bf45beb93dccfa5;p=pettanr%2Fpettanr.git t#29510: --- diff --git a/app/controllers/comics_controller.rb b/app/controllers/comics_controller.rb index 38077173..3eda75eb 100644 --- a/app/controllers/comics_controller.rb +++ b/app/controllers/comics_controller.rb @@ -8,11 +8,6 @@ class ComicsController < ApplicationController 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 diff --git a/spec/models/artist_spec.rb b/spec/models/artist_spec.rb index 3bfff22a..629097b7 100644 --- a/spec/models/artist_spec.rb +++ b/spec/models/artist_spec.rb @@ -172,10 +172,10 @@ describe Artist do @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 diff --git a/spec/models/author_spec.rb b/spec/models/author_spec.rb index 3444f9a6..1dbe0f5a 100644 --- a/spec/models/author_spec.rb +++ b/spec/models/author_spec.rb @@ -205,10 +205,10 @@ describe Author do @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 diff --git a/spec/models/color_spec.rb b/spec/models/color_spec.rb index 5397f1f6..e23354df 100644 --- a/spec/models/color_spec.rb +++ b/spec/models/color_spec.rb @@ -190,10 +190,10 @@ describe Color do @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 diff --git a/spec/models/comic_spec.rb b/spec/models/comic_spec.rb index adf62c5a..77712b4e 100644 --- a/spec/models/comic_spec.rb +++ b/spec/models/comic_spec.rb @@ -326,7 +326,7 @@ describe Comic do @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) end it '通常は全件(5件)を返す' do r = Comic.mylist @author, 5, 0 diff --git a/spec/models/ground_color_spec.rb b/spec/models/ground_color_spec.rb index 18104573..35ae8d84 100644 --- a/spec/models/ground_color_spec.rb +++ b/spec/models/ground_color_spec.rb @@ -177,6 +177,7 @@ describe GroundColor do @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 @@ -302,6 +303,7 @@ describe GroundColor do @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) end it '通常は全件(5件)を返す' do r = GroundColor.mylist @author, 5, 0 diff --git a/spec/models/ground_picture_spec.rb b/spec/models/ground_picture_spec.rb index a44c371e..e2e449f3 100644 --- a/spec/models/ground_picture_spec.rb +++ b/spec/models/ground_picture_spec.rb @@ -177,6 +177,7 @@ describe GroundPicture do @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 @@ -323,6 +324,7 @@ describe GroundPicture do @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) end it '通常は全件(5件)を返す' do r = GroundPicture.mylist @author, 5, 0 diff --git a/spec/models/original_picture_spec.rb b/spec/models/original_picture_spec.rb index c787b6fa..4f8e1357 100644 --- a/spec/models/original_picture_spec.rb +++ b/spec/models/original_picture_spec.rb @@ -381,6 +381,7 @@ describe OriginalPicture do @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) end it '通常は全件(5件)を返す' do r = OriginalPicture.mylist @artist, 5, 0 diff --git a/spec/models/panel_color_spec.rb b/spec/models/panel_color_spec.rb index 1e960dee..07e61475 100644 --- a/spec/models/panel_color_spec.rb +++ b/spec/models/panel_color_spec.rb @@ -188,6 +188,7 @@ describe PanelColor do @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 @@ -302,6 +303,7 @@ describe PanelColor do @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) end it '通常は全件(5件)を返す' do r = PanelColor.mylist @author, 5, 0 diff --git a/spec/models/panel_picture_spec.rb b/spec/models/panel_picture_spec.rb index 3a399c84..f9c1a28a 100644 --- a/spec/models/panel_picture_spec.rb +++ b/spec/models/panel_picture_spec.rb @@ -385,6 +385,7 @@ describe PanelPicture do :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 @@ -544,6 +545,7 @@ describe PanelPicture do :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) end it '通常は全件(5件)を返す' do r = PanelPicture.mylist @author, 5, 0 diff --git a/spec/models/panel_spec.rb b/spec/models/panel_spec.rb index 01f94702..35147adc 100644 --- a/spec/models/panel_spec.rb +++ b/spec/models/panel_spec.rb @@ -458,7 +458,7 @@ describe Panel do @npl3 = FactoryGirl.create :panel, :author_id => @author.id, :updated_at => Time.now + 200 @npl4 = FactoryGirl.create :panel, :author_id => @author.id, :updated_at => Time.now + 300 @npl5 = FactoryGirl.create :panel, :author_id => @author.id, :updated_at => Time.now + 400 - Panel.stub(:default_page_size).and_return(2) + Author.stub(:default_panel_page_size).and_return(2) end it '通常は全件(5件)を返す' do r = Panel.mylist @author, 5, 0 diff --git a/spec/models/story_spec.rb b/spec/models/story_spec.rb index 31c1ecc0..2b0ef00c 100644 --- a/spec/models/story_spec.rb +++ b/spec/models/story_spec.rb @@ -364,6 +364,7 @@ describe Story do @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) end it '通常は全件(5件)を返す' do r = Story.mylist @author, 5, 0