OSDN Git Service

fix: racer
[pettanr/pettanr.git] / spec / controllers / authors_controller_spec.rb
index a1dabb8..950361c 100644 (file)
@@ -4,10 +4,13 @@ require 'spec_helper'
 
 describe AuthorsController do
   before do
+    SpeechBalloonTemplate.delete_all
     @admin =FactoryGirl.create :admin
     @sp = FactoryGirl.create :system_picture
     @lg = FactoryGirl.create :license_group
     @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
+    @speech_balloon_template = FactoryGirl.create :speech_balloon_template, "name" => "circle@pettan.com", "classname" => "CircleSpeechBalloon", "caption" => "cc",  "system_picture_id" => @sp.id, "settings" => '{}'
+    @writing_format = FactoryGirl.create :writing_format
     @user = FactoryGirl.create( :user_yas)
     @author = FactoryGirl.create :author, :user_id => @user.id
     @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
@@ -242,87 +245,749 @@ if MagicNumber['run_mode'] == 1
 =end
   end
   
+  describe '対象作家のスクロール一覧表示に於いて' do
+    before do
+      @other_user = FactoryGirl.create( :user_yas)
+      @other_author = FactoryGirl.create :author, :user_id => @other_user.id
+      @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+      @scroll = FactoryGirl.create :scroll, :author_id => @other_user.author.id
+      Author.stub(:show).and_return(@other_author)
+      Scroll.stub(:himlist).and_return([@scroll, @scroll, @scroll])
+      sign_in @user
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :scrolls, :id => @other_author.id, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :scrolls, :id => @other_author.id
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :scrolls, :id => @other_author.id, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :scrolls, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_scroll_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :scrolls, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.scroll_max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :scrolls, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_scroll_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :scrolls, :id => @other_author.id
+        response.should be_success 
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :scrolls, :id => @other_author.id
+      end
+      it 'スクロールモデルに一覧を問い合わせている' do
+        Scroll.should_receive(:himlist).exactly(1)
+        get :scrolls, :id => @other_author.id
+      end
+      it '@scrollsにリストを取得している' do
+        get :scrolls, :id => @other_author.id
+        assigns(:scrolls).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it '@paginateにページ制御を取得している' do
+          get :scrolls, :id => @other_author.id
+          assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
+        end
+        it 'scrollsテンプレートを描画する' do
+          get :scrolls, :id => @other_author.id
+          response.should render_template("scrolls")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :scrolls, :id => @other_author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'スクロールモデルにjson一覧出力オプションを問い合わせている' do
+          Scroll.should_receive(:list_json_opt).exactly(1)
+          get :scrolls, :id => @other_author.id, :format => :json
+        end
+        it 'データがリスト構造になっている' do
+          get :scrolls, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはスクロールっぽいものであって欲しい' do
+          get :scrolls, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("title").should be_true
+          json.first.has_key?("visible").should be_true
+        end
+      end
+    end
+    context 'ユーザ権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :scrolls, :id => @other_author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :scrolls, :id => @other_author.id
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :scrolls, :id => @other_author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :scrolls, :id => @other_author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+    context 'ユーザ権限はないが管理者権限があるとき' do
+      before do
+        sign_out @user
+        sign_in @admin
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :scrolls, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+    context 'ユーザだが作家登録していないとき' do
+      before do
+        @author.destroy
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :scrolls, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+  end
+  
+  describe '対象作家のスクコマ一覧表示に於いて' do
+    before do
+      @other_user = FactoryGirl.create( :user_yas)
+      @other_author = FactoryGirl.create :author, :user_id => @other_user.id
+      @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+      @scroll = FactoryGirl.create :scroll, :author_id => @other_user.author.id
+      @panel = FactoryGirl.create :panel, :author_id => @other_user.author.id
+      @scroll_panel = FactoryGirl.create :scroll_panel, :t => 0, :scroll_id => @scroll.id, :panel_id => @panel.id, :author_id => @other_user.author.id
+      Author.stub(:show).and_return(@other_author)
+      ScrollPanel.stub(:himlist).and_return([@scroll_panel, @scroll_panel, @scroll_panel])
+      sign_in @user
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :scroll_panels, :id => @other_author.id, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :scroll_panels, :id => @other_author.id
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :scroll_panels, :id => @other_author.id, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :scroll_panels, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_scroll_panel_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :scroll_panels, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.scroll_panel_max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :scroll_panels, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_scroll_panel_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :scroll_panels, :id => @other_author.id
+        response.should be_success 
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :scroll_panels, :id => @other_author.id
+      end
+      it 'スクコマモデルに他作家のスクコマ一覧を問い合わせている' do
+        ScrollPanel.should_receive(:himlist).exactly(1)
+        get :scroll_panels, :id => @other_author.id
+      end
+      it '@scroll_panelsにリストを取得している' do
+        get :scroll_panels, :id => @other_author.id
+        assigns(:scroll_panels).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it '@paginateにページ制御を取得している' do
+          get :scroll_panels, :id => @other_author.id
+          assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
+        end
+        it 'scroll_panelsテンプレートを描画する' do
+          get :scroll_panels, :id => @other_author.id
+          response.should render_template("scroll_panels")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :scroll_panels, :id => @other_author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'スクコマモデルにjson一覧出力オプションを問い合わせている' do
+          ScrollPanel.should_receive(:list_json_opt).exactly(1)
+          get :scroll_panels, :id => @other_author.id, :format => :json
+        end
+        it 'データがリスト構造になっている' do
+          get :scroll_panels, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはスクコマっぽいものであって欲しい' do
+          get :scroll_panels, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("panel_id").should be_true
+          json.first.has_key?("scroll_id").should be_true
+          json.first.has_key?("t").should be_true
+        end
+      end
+    end
+    context 'ユーザ権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :scroll_panels, :id => @other_author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :scroll_panels, :id => @other_author.id
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :scroll_panels, :id => @other_author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :scroll_panels, :id => @other_author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+    context 'ユーザ権限はないが管理者権限があるとき' do
+      before do
+        sign_out @user
+        sign_in @admin
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :scroll_panels, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+    context 'ユーザだが作家登録していないとき' do
+      before do
+        @author.destroy
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :scroll_panels, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+  end
+  
   describe '対象作家のコミック一覧表示に於いて' do
     before do
       @other_user = FactoryGirl.create( :user_yas)
       @other_author = FactoryGirl.create :author, :user_id => @other_user.id
       @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
-      @comic = FactoryGirl.create :comic, :author_id => @other_user.author.id
+      @comic = FactoryGirl.create :comic, :author_id => @author.id
+      Author.stub(:show).and_return(@other_author)
+      Comic.stub(:himlist).and_return([@comic, @comic, @comic])
+      sign_in @user
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :comics, :id => @other_author.id, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :comics, :id => @other_author.id
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :comics, :id => @other_author.id, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :comics, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_comic_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :comics, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.comic_max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :comics, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_comic_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :comics, :id => @other_author.id
+        response.should be_success 
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :comics, :id => @other_author.id
+      end
+      it 'コミックモデルに一覧を問い合わせている' do
+        Comic.should_receive(:himlist).exactly(1)
+        get :comics, :id => @other_author.id
+      end
+      it '@comicsにリストを取得している' do
+        get :comics, :id => @other_author.id
+        assigns(:comics).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it '@paginateにページ制御を取得している' do
+          get :comics, :id => @other_author.id
+          assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
+        end
+        it 'comicsテンプレートを描画する' do
+          get :comics, :id => @other_author.id
+          response.should render_template("comics")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :comics, :id => @other_author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'コミックモデルにjson一覧出力オプションを問い合わせている' do
+          Comic.should_receive(:list_json_opt).exactly(1)
+          get :comics, :id => @other_author.id, :format => :json
+        end
+        it 'データがリスト構造になっている' do
+          get :comics, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはコミックっぽいものであって欲しい' do
+          get :comics, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("title").should be_true
+          json.first.has_key?("visible").should be_true
+        end
+      end
+    end
+    context 'ユーザ権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :comics, :id => @other_author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :comics, :id => @other_author.id
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :comics, :id => @other_author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :comics, :id => @other_author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+    context 'ユーザ権限はないが管理者権限があるとき' do
+      before do
+        sign_out @user
+        sign_in @admin
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :comics, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+    context 'ユーザだが作家登録していないとき' do
+      before do
+        @author.destroy
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :comics, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+  end
+  
+  describe '対象作家のストーリー一覧表示に於いて' do
+    before do
+      @other_user = FactoryGirl.create( :user_yas)
+      @other_author = FactoryGirl.create :author, :user_id => @other_user.id
+      @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+      @comic = FactoryGirl.create :comic, :author_id => @author.id
+      @story = FactoryGirl.create :story, :comic_id => @comic.id, :visible => 1
+      Author.stub(:show).and_return(@other_author)
+      Story.stub(:himlist).and_return([@story, @story, @story])
+      sign_in @user
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :stories, :id => @other_author.id, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :stories, :id => @other_author.id
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :stories, :id => @other_author.id, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :stories, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_story_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :stories, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.story_max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :stories, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_story_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :stories, :id => @other_author.id
+        response.should be_success 
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :stories, :id => @other_author.id
+      end
+      it 'ストーリーモデルに他作家のストーリー一覧を問い合わせている' do
+        Story.should_receive(:himlist).exactly(1)
+        get :stories, :id => @other_author.id
+      end
+      it '@storiesにリストを取得している' do
+        get :stories, :id => @other_author.id
+        assigns(:stories).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it '@paginateにページ制御を取得している' do
+          get :stories, :id => @other_author.id
+          assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
+        end
+        it 'storiesテンプレートを描画する' do
+          get :stories, :id => @other_author.id
+          response.should render_template("stories")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :stories, :id => @other_author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'ストーリーモデルにjson一覧出力オプションを問い合わせている' do
+          Story.should_receive(:list_json_opt).exactly(1)
+          get :stories, :id => @other_author.id, :format => :json
+        end
+        it 'データがリスト構造になっている' do
+          get :stories, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはストーリーっぽいものであって欲しい' do
+          get :stories, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("comic_id").should be_true
+          json.first.has_key?("title").should be_true
+        end
+      end
+    end
+    context 'ユーザ権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :stories, :id => @other_author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :stories, :id => @other_author.id
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :stories, :id => @other_author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :stories, :id => @other_author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+    context 'ユーザ権限はないが管理者権限があるとき' do
+      before do
+        sign_out @user
+        sign_in @admin
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :stories, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+    context 'ユーザだが作家登録していないとき' do
+      before do
+        @author.destroy
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :stories, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+  end
+  
+  describe '対象作家のスト紙一覧表示に於いて' do
+    before do
+      @other_user = FactoryGirl.create( :user_yas)
+      @other_author = FactoryGirl.create :author, :user_id => @other_user.id
+      @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+      @comic = FactoryGirl.create :comic, :author_id => @author.id
+      @story = FactoryGirl.create :story, :comic_id => @comic.id, :visible => 1
+      @sheet = FactoryGirl.create :sheet, :author_id => @author.id
+      @story_sheet = FactoryGirl.create :story_sheet, :author_id => @author.id, :story_id => @story.id, :sheet_id => @sheet.id
+      Author.stub(:show).and_return(@other_author)
+      StorySheet.stub(:himlist).and_return([@story_sheet, @story_sheet, @story_sheet])
+      sign_in @user
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :story_sheets, :id => @other_author.id, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :story_sheets, :id => @other_author.id
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :story_sheets, :id => @other_author.id, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :story_sheets, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_story_sheet_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :story_sheets, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.story_sheet_max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :story_sheets, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_story_sheet_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :story_sheets, :id => @other_author.id
+        response.should be_success 
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :story_sheets, :id => @other_author.id
+      end
+      it 'スト紙モデルに他作家のスト紙一覧を問い合わせている' do
+        StorySheet.should_receive(:himlist).exactly(1)
+        get :story_sheets, :id => @other_author.id
+      end
+      it '@story_sheetsにリストを取得している' do
+        get :story_sheets, :id => @other_author.id
+        assigns(:story_sheets).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it '@paginateにページ制御を取得している' do
+          get :story_sheets, :id => @other_author.id
+          assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
+        end
+        it 'story_sheetsテンプレートを描画する' do
+          get :story_sheets, :id => @other_author.id
+          response.should render_template("story_sheets")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :story_sheets, :id => @other_author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'スト紙モデルにjson一覧出力オプションを問い合わせている' do
+          StorySheet.should_receive(:list_json_opt).exactly(1)
+          get :story_sheets, :id => @other_author.id, :format => :json
+        end
+        it 'データがリスト構造になっている' do
+          get :story_sheets, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはスト紙っぽいものであって欲しい' do
+          get :story_sheets, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("story_id").should be_true
+          json.first.has_key?("sheet_id").should be_true
+        end
+      end
+    end
+    context 'ユーザ権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :story_sheets, :id => @other_author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :story_sheets, :id => @other_author.id
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :story_sheets, :id => @other_author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :story_sheets, :id => @other_author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+    context 'ユーザ権限はないが管理者権限があるとき' do
+      before do
+        sign_out @user
+        sign_in @admin
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :story_sheets, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+    context 'ユーザだが作家登録していないとき' do
+      before do
+        @author.destroy
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :story_sheets, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+  end
+  
+  describe '対象作家の用紙一覧表示に於いて' do
+    before do
+      @other_user = FactoryGirl.create( :user_yas)
+      @other_author = FactoryGirl.create :author, :user_id => @other_user.id
+      @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+      @sheet = FactoryGirl.create :sheet, :author_id => @other_user.author.id
       Author.stub(:show).and_return(@other_author)
-      Comic.stub(:himlist).and_return([@comic, @comic, @comic])
+      Sheet.stub(:himlist).and_return([@sheet, @sheet, @sheet])
       sign_in @user
     end
     context 'パラメータpageについて' do
       it '@pageに値が入る' do
-        get :comics, :id => @other_author.id, :page => 5
+        get :sheets, :id => @other_author.id, :page => 5
         assigns(:page).should eq 5
       end
       it '省略されると@pageに1値が入る' do
-        get :comics, :id => @other_author.id
+        get :sheets, :id => @other_author.id
         assigns(:page).should eq 1
       end
       it '与えられたpage_sizeがセットされている' do
-        get :comics, :id => @other_author.id, :page_size => 15
+        get :sheets, :id => @other_author.id, :page_size => 15
         assigns(:page_size).should eq 15
       end
       it '省略されると@page_sizeにデフォルト値が入る' do
-        get :comics, :id => @other_author.id
-        assigns(:page_size).should eq Author.default_comic_page_size
+        get :sheets, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_sheet_page_size
       end
       it '最大を超えると@page_sizeにデフォルト最大値が入る' do
-        get :comics, :id => @other_author.id, :page_size => 1500
-        assigns(:page_size).should eq Author.comic_max_page_size
+        get :sheets, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.sheet_max_page_size
       end
       it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
-        get :comics, :id => @other_author.id, :page_size => 0
-        assigns(:page_size).should eq Author.default_comic_page_size
+        get :sheets, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_sheet_page_size
       end
     end
     context 'つつがなく終わるとき' do
       it 'ステータスコード200 OKを返す' do
-        get :comics, :id => @other_author.id
+        get :sheets, :id => @other_author.id
         response.should be_success 
       end
       it '作家モデルに単体取得を問い合わせている' do
         Author.should_receive(:show).exactly(1)
-        get :comics, :id => @other_author.id
+        get :sheets, :id => @other_author.id
       end
-      it 'コミックモデルに一覧を問い合わせている' do
-        Comic.should_receive(:himlist).exactly(1)
-        get :comics, :id => @other_author.id
+      it '用紙モデルに一覧を問い合わせている' do
+        Sheet.should_receive(:himlist).exactly(1)
+        get :sheets, :id => @other_author.id
       end
-      it '@comicsにリストを取得している' do
-        get :comics, :id => @other_author.id
-        assigns(:comics).should have_at_least(3).items
+      it '@sheetsにリストを取得している' do
+        get :sheets, :id => @other_author.id
+        assigns(:sheets).should have_at_least(3).items
       end
       context 'html形式' do
         it '@paginateにページ制御を取得している' do
-          get :comics, :id => @other_author.id
+          get :sheets, :id => @other_author.id
           assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
         end
-        it 'comicsテンプレートを描画する' do
-          get :comics, :id => @other_author.id
-          response.should render_template("comics")
+        it 'sheetsテンプレートを描画する' do
+          get :sheets, :id => @other_author.id
+          response.should render_template("sheets")
         end
       end
       context 'json形式' do
         it 'jsonデータを返す' do
-          get :comics, :id => @other_author.id, :format => :json
+          get :sheets, :id => @other_author.id, :format => :json
           lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
         end
-        it 'コミックモデルにjson一覧出力オプションを問い合わせている' do
-          Comic.should_receive(:list_json_opt).exactly(1)
-          get :comics, :id => @other_author.id, :format => :json
+        it '用紙モデルにjson一覧出力オプションを問い合わせている' do
+          Sheet.should_receive(:list_json_opt).exactly(1)
+          get :sheets, :id => @other_author.id, :format => :json
         end
         it 'データがリスト構造になっている' do
-          get :comics, :id => @other_author.id, :format => :json
+          get :sheets, :id => @other_author.id, :format => :json
           json = JSON.parse response.body
           json.should have_at_least(3).items
         end
-        it 'リストの先頭くらいはコミックっぽいものであって欲しい' do
-          get :comics, :id => @other_author.id, :format => :json
+        it 'リストの先頭くらいは用紙っぽいものであって欲しい' do
+          get :sheets, :id => @other_author.id, :format => :json
           json = JSON.parse response.body
-          json.first.has_key?("title").should be_true
+          json.first.has_key?("caption").should be_true
           json.first.has_key?("visible").should be_true
         end
       end
@@ -333,21 +998,21 @@ if MagicNumber['run_mode'] == 1
       end
       context 'html形式' do
         it 'ステータスコード302 Foundを返す' do
-          get :comics, :id => @other_author.id
+          get :sheets, :id => @other_author.id
           response.status.should eq 302
         end
         it 'サインインページへ遷移する' do
-          get :comics, :id => @other_author.id
+          get :sheets, :id => @other_author.id
           response.should redirect_to '/users/sign_in'
         end
       end
       context 'json形式' do
         it 'ステータスコード401 Unauthorizedを返す' do
-          get :comics, :id => @other_author.id, :format => :json
+          get :sheets, :id => @other_author.id, :format => :json
           response.status.should eq 401
         end
         it '応答メッセージにUnauthorizedを返す' do
-          get :comics, :id => @other_author.id, :format => :json
+          get :sheets, :id => @other_author.id, :format => :json
           response.message.should match(/Unauthorized/)
         end
       end
@@ -358,7 +1023,7 @@ if MagicNumber['run_mode'] == 1
         sign_in @admin
       end
       it 'ステータスコード200 OKを返す' do
-        get :comics, :id => @other_author.id
+        get :sheets, :id => @other_author.id
         response.should be_success 
       end
     end
@@ -367,96 +1032,96 @@ if MagicNumber['run_mode'] == 1
         @author.destroy
       end
       it 'ステータスコード200 OKを返す' do
-        get :comics, :id => @other_author.id
+        get :sheets, :id => @other_author.id
         response.should be_success 
       end
     end
   end
   
-  describe '対象作家のストーリー一覧表示に於いて' do
+  describe '対象作家の紙コマ一覧表示に於いて' do
     before do
       @other_user = FactoryGirl.create( :user_yas)
       @other_author = FactoryGirl.create :author, :user_id => @other_user.id
       @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
-      @comic = FactoryGirl.create :comic, :author_id => @other_user.author.id
+      @sheet = FactoryGirl.create :sheet, :author_id => @other_user.author.id
       @panel = FactoryGirl.create :panel, :author_id => @other_user.author.id
-      @story = FactoryGirl.create :story, :t => 0, :comic_id => @comic.id, :panel_id => @panel.id, :author_id => @other_user.author.id
+      @sheet_panel = FactoryGirl.create :sheet_panel, :t => 0, :sheet_id => @sheet.id, :panel_id => @panel.id, :author_id => @other_user.author.id
       Author.stub(:show).and_return(@other_author)
-      Story.stub(:himlist).and_return([@story, @story, @story])
+      SheetPanel.stub(:himlist).and_return([@sheet_panel, @sheet_panel, @sheet_panel])
       sign_in @user
     end
     context 'パラメータpageについて' do
       it '@pageに値が入る' do
-        get :stories, :id => @other_author.id, :page => 5
+        get :sheet_panels, :id => @other_author.id, :page => 5
         assigns(:page).should eq 5
       end
       it '省略されると@pageに1値が入る' do
-        get :stories, :id => @other_author.id
+        get :sheet_panels, :id => @other_author.id
         assigns(:page).should eq 1
       end
       it '与えられたpage_sizeがセットされている' do
-        get :stories, :id => @other_author.id, :page_size => 15
+        get :sheet_panels, :id => @other_author.id, :page_size => 15
         assigns(:page_size).should eq 15
       end
       it '省略されると@page_sizeにデフォルト値が入る' do
-        get :stories, :id => @other_author.id
-        assigns(:page_size).should eq Author.default_story_page_size
+        get :sheet_panels, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_sheet_panel_page_size
       end
       it '最大を超えると@page_sizeにデフォルト最大値が入る' do
-        get :stories, :id => @other_author.id, :page_size => 1500
-        assigns(:page_size).should eq Author.story_max_page_size
+        get :sheet_panels, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.sheet_panel_max_page_size
       end
       it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
-        get :stories, :id => @other_author.id, :page_size => 0
-        assigns(:page_size).should eq Author.default_story_page_size
+        get :sheet_panels, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_sheet_panel_page_size
       end
     end
     context 'つつがなく終わるとき' do
       it 'ステータスコード200 OKを返す' do
-        get :stories, :id => @other_author.id
+        get :sheet_panels, :id => @other_author.id
         response.should be_success 
       end
       it '作家モデルに単体取得を問い合わせている' do
         Author.should_receive(:show).exactly(1)
-        get :stories, :id => @other_author.id
+        get :sheet_panels, :id => @other_author.id
       end
-      it 'ストーリーモデルに他作家のストーリー一覧を問い合わせている' do
-        Story.should_receive(:himlist).exactly(1)
-        get :stories, :id => @other_author.id
+      it '紙コマモデルに他作家の紙コマ一覧を問い合わせている' do
+        SheetPanel.should_receive(:himlist).exactly(1)
+        get :sheet_panels, :id => @other_author.id
       end
-      it '@storiesにリストを取得している' do
-        get :stories, :id => @other_author.id
-        assigns(:stories).should have_at_least(3).items
+      it '@sheet_panelsにリストを取得している' do
+        get :sheet_panels, :id => @other_author.id
+        assigns(:sheet_panels).should have_at_least(3).items
       end
       context 'html形式' do
         it '@paginateにページ制御を取得している' do
-          get :stories, :id => @other_author.id
+          get :sheet_panels, :id => @other_author.id
           assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
         end
-        it 'storiesテンプレートを描画する' do
-          get :stories, :id => @other_author.id
-          response.should render_template("stories")
+        it 'sheet_panelsテンプレートを描画する' do
+          get :sheet_panels, :id => @other_author.id
+          response.should render_template("sheet_panels")
         end
       end
       context 'json形式' do
         it 'jsonデータを返す' do
-          get :stories, :id => @other_author.id, :format => :json
+          get :sheet_panels, :id => @other_author.id, :format => :json
           lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
         end
-        it 'ストーリーモデルにjson一覧出力オプションを問い合わせている' do
-          Story.should_receive(:list_json_opt).exactly(1)
-          get :stories, :id => @other_author.id, :format => :json
+        it '紙コマモデルにjson一覧出力オプションを問い合わせている' do
+          SheetPanel.should_receive(:list_json_opt).exactly(1)
+          get :sheet_panels, :id => @other_author.id, :format => :json
         end
         it 'データがリスト構造になっている' do
-          get :stories, :id => @other_author.id, :format => :json
+          get :sheet_panels, :id => @other_author.id, :format => :json
           json = JSON.parse response.body
           json.should have_at_least(3).items
         end
-        it 'リストの先頭くらいはストーリーっぽいものであって欲しい' do
-          get :stories, :id => @other_author.id, :format => :json
+        it 'リストの先頭くらいは紙コマっぽいものであって欲しい' do
+          get :sheet_panels, :id => @other_author.id, :format => :json
           json = JSON.parse response.body
           json.first.has_key?("panel_id").should be_true
-          json.first.has_key?("comic_id").should be_true
+          json.first.has_key?("sheet_id").should be_true
           json.first.has_key?("t").should be_true
         end
       end
@@ -467,21 +1132,21 @@ if MagicNumber['run_mode'] == 1
       end
       context 'html形式' do
         it 'ステータスコード302 Foundを返す' do
-          get :stories, :id => @other_author.id
+          get :sheet_panels, :id => @other_author.id
           response.status.should eq 302
         end
         it 'サインインページへ遷移する' do
-          get :stories, :id => @other_author.id
+          get :sheet_panels, :id => @other_author.id
           response.should redirect_to '/users/sign_in'
         end
       end
       context 'json形式' do
         it 'ステータスコード401 Unauthorizedを返す' do
-          get :stories, :id => @other_author.id, :format => :json
+          get :sheet_panels, :id => @other_author.id, :format => :json
           response.status.should eq 401
         end
         it '応答メッセージにUnauthorizedを返す' do
-          get :stories, :id => @other_author.id, :format => :json
+          get :sheet_panels, :id => @other_author.id, :format => :json
           response.message.should match(/Unauthorized/)
         end
       end
@@ -492,7 +1157,7 @@ if MagicNumber['run_mode'] == 1
         sign_in @admin
       end
       it 'ステータスコード200 OKを返す' do
-        get :stories, :id => @other_author.id
+        get :sheet_panels, :id => @other_author.id
         response.should be_success 
       end
     end
@@ -501,7 +1166,7 @@ if MagicNumber['run_mode'] == 1
         @author.destroy
       end
       it 'ステータスコード200 OKを返す' do
-        get :stories, :id => @other_author.id
+        get :sheet_panels, :id => @other_author.id
         response.should be_success 
       end
     end
@@ -773,6 +1438,147 @@ if MagicNumber['run_mode'] == 1
     end
   end
   
+  describe '対象作家のフキダシ一覧表示に於いて' do
+    before do
+      @other_user = FactoryGirl.create( :user_yas)
+      @other_author = FactoryGirl.create :author, :user_id => @other_user.id
+      @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+      @panel = FactoryGirl.create :panel, :author_id => @other_author.id
+      @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
+      @speech = @sb.build_speech(
+        FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
+      )
+      @balloon = @sb.build_balloon(
+        FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
+      )
+      @sb.boost
+      @sb.save!
+      Author.stub(:show).and_return(@other_author)
+      SpeechBalloon.stub(:himlist).and_return([@sb, @sb, @sb])
+      sign_in @user
+    end
+    context 'パラメータpageについて' do
+      it '@pageに値が入る' do
+        get :speech_balloons, :id => @other_author.id, :page => 5
+        assigns(:page).should eq 5
+      end
+      it '省略されると@pageに1値が入る' do
+        get :speech_balloons, :id => @other_author.id
+        assigns(:page).should eq 1
+      end
+      it '与えられたpage_sizeがセットされている' do
+        get :speech_balloons, :id => @other_author.id, :page_size => 15
+        assigns(:page_size).should eq 15
+      end
+      it '省略されると@page_sizeにデフォルト値が入る' do
+        get :speech_balloons, :id => @other_author.id
+        assigns(:page_size).should eq Author.default_speech_balloon_page_size
+      end
+      it '最大を超えると@page_sizeにデフォルト最大値が入る' do
+        get :speech_balloons, :id => @other_author.id, :page_size => 1500
+        assigns(:page_size).should eq Author.speech_balloon_max_page_size
+      end
+      it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
+        get :speech_balloons, :id => @other_author.id, :page_size => 0
+        assigns(:page_size).should eq Author.default_speech_balloon_page_size
+      end
+    end
+    context 'つつがなく終わるとき' do
+      it 'ステータスコード200 OKを返す' do
+        get :speech_balloons, :id => @other_author.id
+        response.should be_success 
+      end
+      it '作家モデルに単体取得を問い合わせている' do
+        Author.should_receive(:show).exactly(1)
+        get :speech_balloons, :id => @other_author.id
+      end
+      it 'フキダシモデルに他作家のフキダシ一覧を問い合わせている' do
+        SpeechBalloon.should_receive(:himlist).exactly(1)
+        get :speech_balloons, :id => @other_author.id
+      end
+      it '@speech_balloonsにリストを取得している' do
+        get :speech_balloons, :id => @other_author.id
+        assigns(:speech_balloons).should have_at_least(3).items
+      end
+      context 'html形式' do
+        it '@paginateにページ制御を取得している' do
+          get :speech_balloons, :id => @other_author.id
+          assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true
+        end
+        it 'speech_balloonsテンプレートを描画する' do
+          get :speech_balloons, :id => @other_author.id
+          response.should render_template("speech_balloons")
+        end
+      end
+      context 'json形式' do
+        it 'jsonデータを返す' do
+          get :speech_balloons, :id => @other_author.id, :format => :json
+          lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
+        end
+        it 'フキダシモデルにjson一覧出力オプションを問い合わせている' do
+          SpeechBalloon.should_receive(:list_json_opt).exactly(1)
+          get :speech_balloons, :id => @other_author.id, :format => :json
+        end
+        it 'データがリスト構造になっている' do
+          get :speech_balloons, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.should have_at_least(3).items
+        end
+        it 'リストの先頭くらいはフキダシっぽいものであって欲しい' do
+          get :speech_balloons, :id => @other_author.id, :format => :json
+          json = JSON.parse response.body
+          json.first.has_key?("speech_balloon_template_id").should be_true
+          json.first.has_key?("z").should be_true
+          json.first.has_key?("t").should be_true
+        end
+      end
+    end
+    context 'ユーザ権限がないとき' do
+      before do
+        sign_out @user
+      end
+      context 'html形式' do
+        it 'ステータスコード302 Foundを返す' do
+          get :speech_balloons, :id => @other_author.id
+          response.status.should eq 302
+        end
+        it 'サインインページへ遷移する' do
+          get :speech_balloons, :id => @other_author.id
+          response.should redirect_to '/users/sign_in'
+        end
+      end
+      context 'json形式' do
+        it 'ステータスコード401 Unauthorizedを返す' do
+          get :speech_balloons, :id => @other_author.id, :format => :json
+          response.status.should eq 401
+        end
+        it '応答メッセージにUnauthorizedを返す' do
+          get :speech_balloons, :id => @other_author.id, :format => :json
+          response.message.should match(/Unauthorized/)
+        end
+      end
+    end
+    context 'ユーザ権限はないが管理者権限があるとき' do
+      before do
+        sign_out @user
+        sign_in @admin
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :speech_balloons, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+    context 'ユーザだが作家登録していないとき' do
+      before do
+        @author.destroy
+      end
+      it 'ステータスコード200 OKを返す' do
+        get :speech_balloons, :id => @other_author.id
+        response.should be_success 
+      end
+    end
+  end
+  
   describe '対象作家の絵地一覧表示に於いて' do
     before do
       @other_user = FactoryGirl.create( :user_yas)
@@ -1632,29 +2438,29 @@ else
     end
   end
   
-  describe '対象ä½\9c家ã\81®ã\82³ã\83\9fã\83\83ã\82¯一覧表示に於いて' do
+  describe '対象ä½\9c家ã\81®ã\82¹ã\82¯ã\83­ã\83¼ã\83«一覧表示に於いて' do
     before do
       @other_user = FactoryGirl.create( :user_yas)
       @other_author = FactoryGirl.create :author, :user_id => @other_user.id
       @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
-      @comic = FactoryGirl.create :comic, :author_id => @other_user.author.id
-      Comic.stub(:mylist).and_return([@comic, @comic, @comic])
+      @scroll = FactoryGirl.create :scroll, :author_id => @other_user.author.id
+      Scroll.stub(:mylist).and_return([@scroll, @scroll, @scroll])
       sign_in @user
     end
     context 'つつがなく終わるとき' do
       it 'ステータスコード200 OKを返す' do
-        get :comics, :id => @other_author.id
+        get :scrolls, :id => @other_author.id
         response.should be_success 
       end
       context 'html形式' do
-        it 'comicテンプレートを描画する' do
-          get :comics, :id => @other_author.id
-          response.should render_template("comic")
+        it 'scrollテンプレートを描画する' do
+          get :scrolls, :id => @other_author.id
+          response.should render_template("scroll")
         end
       end
       context 'json形式' do
         it 'jsonデータを返す' do
-          get :comics, :id => @other_author.id, :format => :json
+          get :scrolls, :id => @other_author.id, :format => :json
           lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
         end
       end
@@ -1664,49 +2470,49 @@ else
         sign_out @user
       end
       it 'ステータスコード200 OKを返す' do
-        get :comics, :id => @other_author.id
+        get :scrolls, :id => @other_author.id
         response.should be_success 
       end
       context 'html形式' do
-        it 'comicsテンプレートを描画する' do
-          get :comics, :id => @other_author.id
-          response.should render_template("comics")
+        it 'scrollsテンプレートを描画する' do
+          get :scrolls, :id => @other_author.id
+          response.should render_template("scrolls")
         end
       end
       context 'json形式' do
         it 'jsonデータを返す' do
-          get :comics, :id => @other_author.id, :format => :json
+          get :scrolls, :id => @other_author.id, :format => :json
           lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
         end
       end
     end
   end
   
-  describe '対象ä½\9c家ã\81®ã\82¹ã\83\88ã\83¼ã\83ªã\83¼一覧表示に於いて' do
+  describe '対象ä½\9c家ã\81®ã\82¹ã\82¯ã\82³ã\83\9e一覧表示に於いて' do
     before do
       @other_user = FactoryGirl.create( :user_yas)
       @other_author = FactoryGirl.create :author, :user_id => @other_user.id
       @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
-      @comic = FactoryGirl.create :comic, :author_id => @other_user.author.id
+      @scroll = FactoryGirl.create :scroll, :author_id => @other_user.author.id
       @panel = FactoryGirl.create :panel, :author_id => @other_author.id
-      @story = FactoryGirl.create :story, :t => 0, :comic_id => @comic.id, :panel_id => @panel.id, :author_id => @other_author.id
-      Story.stub(:mylist).and_return([@story, @story, @story])
+      @scroll_panel = FactoryGirl.create :scroll_panel, :t => 0, :scroll_id => @scroll.id, :panel_id => @panel.id, :author_id => @other_author.id
+      ScrollPanel.stub(:mylist).and_return([@scroll_panel, @scroll_panel, @scroll_panel])
       sign_in @user
     end
     context 'つつがなく終わるとき' do
       it 'ステータスコード200 OKを返す' do
-        get :stories, :id => @other_author.id
+        get :scroll_panels, :id => @other_author.id
         response.should be_success 
       end
       context 'html形式' do
-        it 'storiesテンプレートを描画する' do
-          get :stories, :id => @other_author.id
-          response.should render_template("stories")
+        it 'scroll_panelsテンプレートを描画する' do
+          get :scroll_panels, :id => @other_author.id
+          response.should render_template("scroll_panels")
         end
       end
       context 'json形式' do
         it 'jsonデータを返す' do
-          get :stories, :id => @other_author.id, :format => :json
+          get :scroll_panels, :id => @other_author.id, :format => :json
           lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
         end
       end
@@ -1716,18 +2522,18 @@ else
         sign_out @user
       end
       it 'ステータスコード200 OKを返す' do
-        get :stories, :id => @other_author.id
+        get :scroll_panels, :id => @other_author.id
         response.should be_success 
       end
       context 'html形式' do
-        it 'storiesテンプレートを描画する' do
-          get :stories, :id => @other_author.id
-          response.should render_template("stories")
+        it 'scroll_panelsテンプレートを描画する' do
+          get :scroll_panels, :id => @other_author.id
+          response.should render_template("scroll_panels")
         end
       end
       context 'json形式' do
         it 'jsonデータを返す' do
-          get :stories, :id => @other_author.id, :format => :json
+          get :scroll_panels, :id => @other_author.id, :format => :json
           lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
         end
       end