+ describe 'ストーリー一覧ページ制御に於いて' do
+ before do
+ Story.stub(:count).with(any_args).and_return(100)
+ end
+ it 'ページ制御を返す' do
+ r = Story.list_paginate
+ r.is_a?(Kaminari::PaginatableArray).should be_true
+ end
+ it 'ストーリー一覧の取得条件を利用している' do
+ Story.stub(:list_where).with(any_args).and_return('')
+ Story.should_receive(:list_where).with(any_args).exactly(1)
+ r = Story.list_paginate
+ end
+ it 'ページ件数10のとき、3ページ目のオフセットは20から始まる' do
+ r = Story.list_paginate 3, 10
+ r.limit_value.should eq 10
+ r.offset_value.should eq 20
+ end
+ end
+
+ describe '自分のストーリー一覧ページ制御に於いて' do
+ before do
+ Story.stub(:count).with(any_args).and_return(100)
+ end
+ it 'ページ制御を返す' do
+ r = Story.mylist_paginate @author
+ r.is_a?(Kaminari::PaginatableArray).should be_true
+ end
+ it '自分のストーリー一覧の取得条件を利用している' do
+ Story.stub(:mylist_where).with(any_args).and_return('')
+ Story.should_receive(:mylist_where).with(any_args).exactly(1)
+ r = Story.mylist_paginate @author
+ end
+ it 'ページ件数10のとき、3ページ目のオフセットは20から始まる' do
+ r = Story.mylist_paginate @author, 3, 10
+ r.limit_value.should eq 10
+ r.offset_value.should eq 20
+ end
+ end
+
+ describe '他作家のストーリー一覧ページ制御に於いて' do
+ before do
+ Story.stub(:count).with(any_args).and_return(100)
+ end
+ it 'ページ制御を返す' do
+ r = Story.himlist_paginate @other_author
+ r.is_a?(Kaminari::PaginatableArray).should be_true
+ end
+ it '他作家のストーリー一覧の取得条件を利用している' do
+ Story.stub(:himlist_where).with(any_args).and_return('')
+ Story.should_receive(:himlist_where).with(any_args).exactly(1)
+ r = Story.himlist_paginate @other_author
+ end
+ it 'ページ件数10のとき、3ページ目のオフセットは20から始まる' do
+ r = Story.himlist_paginate @other_author, 3, 10
+ r.limit_value.should eq 10
+ r.offset_value.should eq 20
+ end
+ end
+
+ describe 'list関連テーブルプションに於いて' do
+ it '3つの項目を含んでいる' do
+ r = Story.list_opt
+ r.should have(3).items
+ end
+ it 'コミックを含んでいる' do
+ r = Story.list_opt
+ r.has_key?(:comic).should be_true
+ end
+ it 'コミックは作家を含んでいる' do
+ r = Story.list_opt
+ r[:comic].has_key?(:author).should be_true
+ end
+ it '作家を含んでいる' do
+ r = Story.list_opt
+ r.has_key?(:author).should be_true
+ end
+ it 'コマを含んでいる' do
+ r = Story.list_opt
+ r.has_key?(:panel).should be_true
+ end
+ it 'コマは作家を含んでいる' do
+ r = Story.list_opt
+ r[:panel].has_key?(:author).should be_true
+ end
+ it 'コマはコマ絵を含んでいる' do
+ r = Story.list_opt
+ r[:panel].has_key?(:panel_pictures).should be_true
+ end
+ it 'コマ絵は実素材を含んでいる' do
+ r = Story.list_opt
+ r[:panel][:panel_pictures].has_key?(:picture).should be_true
+ end
+ it '実素材は絵師を含んでいる' do
+ r = Story.list_opt
+ r[:panel][:panel_pictures][:picture].has_key?(:artist).should be_true
+ end
+ it '実素材はライセンスを含んでいる' do
+ r = Story.list_opt
+ r[:panel][:panel_pictures][:picture].has_key?(:license).should be_true
+ end
+ it 'コマはフキダシを含んでいる' do
+ r = Story.list_opt
+ r[:panel].has_key?(:speech_balloons).should be_true
+ end
+ it 'フキダシはフキダシ枠を含んでいる' do
+ r = Story.list_opt
+ r[:panel][:speech_balloons].has_key?(:balloons).should be_true
+ end
+ it 'フキダシはセリフを含んでいる' do
+ r = Story.list_opt
+ r[:panel][:speech_balloons].has_key?(:speeches).should be_true
+ end
+ end
+ describe 'json一覧出力オプションに於いて' do
+ end
+