1 # -*- encoding: utf-8 -*-
7 @admin = FactoryGirl.create :admin
8 @demand_user = FactoryGirl.create :demand_user
9 @sp = FactoryGirl.create :system_picture
10 @lg = FactoryGirl.create :license_group
11 @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
12 @user = FactoryGirl.create( :user_yas)
13 @author = FactoryGirl.create :author, :user_id => @user.id
14 @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
15 @other_user = FactoryGirl.create( :user_yas)
16 @other_author = FactoryGirl.create :author, :user_id => @other_user.id
17 @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
22 @scroll = FactoryGirl.build :scroll, :author_id => @author.id
25 context 'オーソドックスなデータのとき' do
29 @scroll.should be_valid
32 @scroll.title = 'a'*100
34 @scroll.should be_valid
38 context 'titleを検証するとき' do
41 @scroll.should_not be_valid
44 @scroll.title = 'a'*101
45 @scroll.should_not be_valid
48 context 'visibleを検証するとき' do
51 @scroll.should_not be_valid
55 @scroll.should_not be_valid
59 @scroll.should_not be_valid
64 describe '文字コード検証に於いて' do
66 @scroll = FactoryGirl.build :scroll, :author_id => @author.id
69 context 'titleを検証するとき' do
70 it 'Shift JISなら失敗する' do
71 @scroll.title = "\x83G\x83r\x83]\x83D"
74 }.should raise_error(Pettanr::BadRequest)
78 context 'descriptionを検証するとき' do
79 it 'Shift JISなら失敗する' do
80 @scroll.description = "\x83G\x83r\x83]\x83D"
83 }.should raise_error(Pettanr::BadRequest)
88 describe 'デフォルト値補充に於いて' do
89 it 'visibleが0になっている' do
90 @scroll = FactoryGirl.build :scroll, :visible => nil
91 @scroll.supply_default
92 @scroll.visible.should eq 0
96 describe '上書き補充に於いて' do
98 @scroll = FactoryGirl.build :scroll, :author_id => nil
99 @scroll.overwrite @author
100 @scroll.author_id.should eq @author.id
104 describe 'ロールリストからの作家取得に於いて' do
105 context 'ロールがユーザのとき' do
106 it 'ユーザから作家を取得して、それを返す' do
107 r = Scroll.get_author_from_roles([@user])
111 context 'ロールが作家のとき' do
113 r = Scroll.get_author_from_roles([@author])
117 context 'ロールが絵師のとき' do
118 it '絵師から作家を取得できれば、それをを返す' do
119 r = Scroll.get_author_from_roles([@artist])
122 it '絵師から作家を取得できないときnilを返す' do
123 @artist.author_id = nil
125 r = Scroll.get_author_from_roles([@artist])
129 context 'ロールが管理者のとき' do
131 r = Scroll.get_author_from_roles([@admin])
137 describe 'ロールリストからの絵師取得に於いて' do
138 context 'ロールがユーザのとき' do
139 it 'ユーザから作家を取得して、そこから絵師を取得できれば、それを返す' do
140 r = Scroll.get_artist_from_roles([@user])
143 it '作家から絵師を取得できないときnilを返す' do
144 @artist.author_id = nil
146 r = Scroll.get_artist_from_roles([@user])
150 context 'ロールが作家のとき' do
151 it 'そこから絵師を取得できれば、それを返す' do
152 r = Scroll.get_artist_from_roles([@author])
155 it '作家から絵師を取得できないときnilを返す' do
156 @artist.author_id = nil
158 r = Scroll.get_artist_from_roles([@author])
162 context 'ロールが絵師のとき' do
164 r = Scroll.get_artist_from_roles([@artist])
168 context 'ロールが管理者のとき' do
170 r = Scroll.get_artist_from_roles([@admin])
176 describe '所持判定に於いて' do
178 @scroll = FactoryGirl.build :scroll, :author_id => @author.id
180 context '事前チェックする' do
181 it '自身にロールリストからの作家取得を依頼している' do
182 Scroll.should_receive(:get_author_from_roles).with(any_args).exactly(1)
183 r = @scroll.own?([@author])
186 context 'ロール内作家が取得できるとき' do
189 it 'ロール内作家のidが自身の作家idと一致するなら許可する' do
190 Scroll.stub(:get_author_from_roles).with(any_args).and_return(@author)
191 r = @scroll.own?([@author])
194 it 'ロール内作家のidが自身の作家idと一致しないならno' do
195 Scroll.stub(:get_author_from_roles).with(any_args).and_return(@other_author)
196 @scroll.own?(@other_author).should be_false
199 context 'ロール内作家が取得できないとき' do
201 Scroll.stub(:get_author_from_roles).with(any_args).and_return(nil)
204 r = @scroll.own?([@author])
210 describe '読者用ロールチェックに於いて' do
212 @scroll = FactoryGirl.build :scroll, :author_id => @author.id
214 context 'ロールリストに作家が含まれるとき' do
215 it 'ロールリストがリストではないとき、リストにする trueを返す' do
216 r = @scroll.reader_role_check(@author)
220 r = @scroll.reader_role_check([@author])
224 context 'ロールリストに絵師が含まれるとき' do
226 r = @scroll.reader_role_check([@artist])
230 context 'ロールリストにユーザが含まれるとき' do
232 r = @scroll.reader_role_check([@user])
236 context 'ロールリストに管理者が含まれるとき' do
238 r = @scroll.reader_role_check([@admin])
242 context 'ロールリストにユーザ、管理者、作家、絵師が含まれないとき' do
244 r = @scroll.reader_role_check([nil])
250 describe '素材読者用ロールチェックに於いて' do
252 @scroll = FactoryGirl.build :scroll, :author_id => @author.id
254 context 'ロールリストに作家が含まれるとき' do
255 it 'ロールリストがリストではないとき、リストにする trueを返す' do
256 r = @scroll.resource_reader_role_check(@author)
260 r = @scroll.resource_reader_role_check([@author])
264 context 'ロールリストに絵師が含まれるとき' do
266 r = @scroll.resource_reader_role_check([@artist])
270 context 'ロールリストにユーザが含まれるとき' do
272 r = @scroll.resource_reader_role_check([@user])
276 context 'ロールリストに管理者が含まれるとき' do
278 r = @scroll.resource_reader_role_check([@admin])
282 context 'ロールリストに借手が含まれるとき' do
284 r = @scroll.resource_reader_role_check([@demand_user])
288 context 'ロールリストにユーザ、管理者、作家、絵師、借手が含まれないとき' do
290 r = @scroll.resource_reader_role_check([nil])
296 describe '閲覧許可に於いて' do
298 @scroll = FactoryGirl.build :scroll, :author_id => @author.id
300 context 'オープンモードのとき' do
302 MagicNumber['run_mode'] = 0
304 it '自身にゲスト用ロールチェックを問い合わせしている' do
305 Scroll.any_instance.stub(:guest_role_check).and_return(true)
306 Scroll.any_instance.should_receive(:guest_role_check).with(any_args).exactly(1)
307 r = @scroll.visible?([@author])
309 it 'ゲスト用ロールチェックが失敗したとき、falseを返す' do
310 Scroll.any_instance.stub(:guest_role_check).and_return(false)
311 r = @scroll.visible?([@author])
315 context 'クローズドモードのとき' do
317 MagicNumber['run_mode'] = 1
319 it '自身に読者用ロールチェックを問い合わせしている' do
320 Scroll.any_instance.stub(:reader_role_check).and_return(true)
321 Scroll.any_instance.should_receive(:reader_role_check).with(any_args).exactly(1)
322 r = @scroll.visible?([@author])
324 it '読者用ロールチェックが失敗したとき、falseを返す' do
325 Scroll.any_instance.stub(:reader_role_check).and_return(false)
326 r = @scroll.visible?([@author])
330 context '事前チェックする' do
332 MagicNumber['run_mode'] = 1
333 Scroll.any_instance.stub(:reader_role_check).and_return(true)
334 Scroll.any_instance.stub(:own?).and_return(true)
336 it '自身に所持判定を問い合わせしている' do
337 Scroll.any_instance.should_receive(:own?).with(any_args).exactly(1)
338 r = @scroll.visible?([@author])
341 context 'つつがなく終わるとき' do
343 MagicNumber['run_mode'] = 1
344 Scroll.any_instance.stub(:reader_role_check).and_return(true)
346 it '自分のコミックなら許可する' do
347 Scroll.any_instance.stub(:own?).and_return(true)
348 Scroll.any_instance.stub(:visible).and_return(0)
349 r = @scroll.visible?([@author])
352 it '他人の非公開コミックなら許可しない' do
353 Scroll.any_instance.stub(:own?).and_return(false)
354 Scroll.any_instance.stub(:visible).and_return(0)
355 r = @scroll.visible?([@author])
358 it '他人のコミックでも公開なら許可する' do
359 Scroll.any_instance.stub(:own?).and_return(false)
360 Scroll.any_instance.stub(:visible).and_return(1)
361 r = @scroll.visible?([@author])
367 describe '一覧取得に於いて' do
369 @scroll = FactoryGirl.create :scroll, :author_id => @author.id
371 context 'page補正について' do
372 it '文字列から数値に変換される' do
373 Scroll.page('8').should eq 8
376 Scroll.page().should eq 1
379 Scroll.page('0').should eq 1
382 context 'page_size補正について' do
383 it '文字列から数値に変換される' do
384 Scroll.page_size('7').should eq 7
386 it 'nilの場合はScroll.default_page_sizeになる' do
387 Scroll.page_size().should eq Scroll.default_page_size
389 it '0以下の場合はScroll.default_page_sizeになる' do
390 Scroll.page_size('0').should eq Scroll.default_page_size
392 it 'Scroll.max_page_sizeを超えた場合はScroll.max_page_sizeになる' do
393 Scroll.page_size('1000').should eq Scroll.max_page_size
396 context 'つつがなく終わるとき' do
397 it '一覧取得オプションを利用している' do
398 Scroll.stub(:list_opt).with(any_args).and_return({})
399 Scroll.should_receive(:list_opt).with(any_args).exactly(1)
405 c.should eq [@scroll]
407 it '非公開コミックは(自分のコミックであっても)含んでいない' do
408 FactoryGirl.create :scroll, :author_id => @author.id, :visible => 0
410 c.should eq [@scroll]
413 #公開コミックは(他人のコミックであっても)含んでいる
414 v = FactoryGirl.create :scroll, :author_id => @other_author.id, :updated_at => Time.now + 100
416 c.should eq [v, @scroll]
418 context 'DBに5件あって1ページの件数を2件に変えたとして' do
420 @scroll2 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 100
421 @scroll3 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 200
422 @scroll4 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 300
423 @scroll5 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 400
424 Scroll.stub(:default_page_size).and_return(2)
428 c.should have(2).items
430 it 'page=1なら末尾2件を返す' do
433 c.should eq [@scroll5, @scroll4]
435 it 'page=2なら中間2件を返す' do
437 c.should eq [@scroll3, @scroll2]
439 it 'page=3なら先頭1件を返す' do
441 c.should eq [@scroll]
446 describe '自分のコミック一覧取得に於いて' do
448 @scroll = FactoryGirl.create :scroll, :author_id => @author.id
450 context 'つつがなく終わるとき' do
451 it '一覧取得オプションを利用している' do
452 Scroll.stub(:list_opt).with(any_args).and_return({})
453 Scroll.should_receive(:list_opt).with(any_args).exactly(1)
454 r = Scroll.mylist @author
458 c = Scroll.mylist @author
459 c.should eq [@scroll]
462 nc = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 100
463 cl = Scroll.mylist @author
464 cl.should eq [nc, @scroll]
466 it '他人のコミックは公開でも含まない' do
467 nc = FactoryGirl.create :scroll, :author_id => @other_author.id, :visible => 1
468 cl = Scroll.mylist @author
469 cl.should eq [@scroll]
471 it '自分のコミックは非公開でも含んでいる' do
472 nc = FactoryGirl.create :scroll, :author_id => @author.id, :visible => 0, :updated_at => Time.now + 100
473 cl = Scroll.mylist @author
474 cl.should eq [nc, @scroll]
476 context 'DBに5件あって1ページの件数を2件に変えたとして' do
478 @scroll2 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 100
479 @scroll3 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 200
480 @scroll4 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 300
481 @scroll5 = FactoryGirl.create :scroll, :author_id => @author.id, :updated_at => Time.now + 400
484 c = Scroll.mylist @author, 1, 2
485 c.should have(2).items
487 it 'page=1なら末尾2件を返す' do
489 c = Scroll.mylist(@author, 1, 2)
490 c.should eq [@scroll5, @scroll4]
492 it 'page=2なら中間2件を返す' do
493 c = Scroll.mylist(@author, 2, 2)
494 c.should eq [@scroll3, @scroll2]
496 it 'page=3なら先頭1件を返す' do
497 c = Scroll.mylist(@author, 3, 2)
498 c.should eq [@scroll]
503 describe '他作家のコミック一覧取得に於いて' do
505 @scroll = FactoryGirl.create :scroll, :author_id => @author.id
506 @other_scroll = FactoryGirl.create :scroll, :author_id => @other_author.id, :visible => 1
508 context 'つつがなく終わるとき' do
509 it '一覧取得オプションを利用している' do
510 Scroll.stub(:list_opt).with(any_args).and_return({})
511 Scroll.should_receive(:list_opt).with(any_args).exactly(1)
512 r = Scroll.himlist @other_author
515 it '指定した作家のリストを返す' do
516 r = Scroll.himlist @other_author
517 r.should eq [@other_scroll]
520 nc = FactoryGirl.create :scroll, :author_id => @other_author.id, :updated_at => Time.now + 100
521 r = Scroll.himlist @other_author
522 r.should eq [nc, @other_scroll]
525 hidden = FactoryGirl.create :scroll, :author_id => @other_author.id, :visible => 0
526 r = Scroll.himlist @other_author
527 r.should eq [@other_scroll]
529 context 'DBに5件あって1ページの件数を2件に変えたとして' do
531 @other_scroll2 = FactoryGirl.create :scroll, :author_id => @other_author.id, :updated_at => Time.now + 100
532 @other_scroll3 = FactoryGirl.create :scroll, :author_id => @other_author.id, :updated_at => Time.now + 200
533 @other_scroll4 = FactoryGirl.create :scroll, :author_id => @other_author.id, :updated_at => Time.now + 300
534 @other_scroll5 = FactoryGirl.create :scroll, :author_id => @other_author.id, :updated_at => Time.now + 400
537 c = Scroll.himlist @other_author, 1, 2
538 c.should have(2).items
540 it 'page=1なら末尾2件を返す' do
542 c = Scroll.himlist(@other_author, 1, 2)
543 c.should eq [@other_scroll5, @other_scroll4]
545 it 'page=2なら中間2件を返す' do
546 c = Scroll.himlist(@other_author, 2, 2)
547 c.should eq [@other_scroll3, @other_scroll2]
549 it 'page=3なら先頭1件を返す' do
550 c = Scroll.himlist(@other_author, 3, 2)
551 c.should eq [@other_scroll]
556 describe 'コミック一覧ページ制御に於いて' do
558 Scroll.stub(:count).with(any_args).and_return(100)
561 r = Scroll.list_paginate
562 r.is_a?(Kaminari::PaginatableArray).should be_true
564 it 'コミック一覧の取得条件を利用している' do
565 Scroll.stub(:list_where).with(any_args).and_return('')
566 Scroll.should_receive(:list_where).with(any_args).exactly(1)
567 r = Scroll.list_paginate
569 it 'ページ件数10のとき、3ページ目のオフセットは20から始まる' do
570 r = Scroll.list_paginate 3, 10
571 r.limit_value.should eq 10
572 r.offset_value.should eq 20
576 describe '自分のコミック一覧ページ制御に於いて' do
578 Scroll.stub(:count).with(any_args).and_return(100)
581 r = Scroll.mylist_paginate @author
582 r.is_a?(Kaminari::PaginatableArray).should be_true
584 it '自分のコミック一覧の取得条件を利用している' do
585 Scroll.stub(:mylist_where).with(any_args).and_return('')
586 Scroll.should_receive(:mylist_where).with(any_args).exactly(1)
587 r = Scroll.mylist_paginate @author
589 it 'ページ件数10のとき、3ページ目のオフセットは20から始まる' do
590 r = Scroll.mylist_paginate @author, 3, 10
591 r.limit_value.should eq 10
592 r.offset_value.should eq 20
596 describe '他作家のコミック一覧ページ制御に於いて' do
598 Scroll.stub(:count).with(any_args).and_return(100)
601 r = Scroll.himlist_paginate @other_author
602 r.is_a?(Kaminari::PaginatableArray).should be_true
604 it '他作家のコミック一覧の取得条件を利用している' do
605 Scroll.stub(:himlist_where).with(any_args).and_return('')
606 Scroll.should_receive(:himlist_where).with(any_args).exactly(1)
607 r = Scroll.himlist_paginate @other_author
609 it 'ページ件数10のとき、3ページ目のオフセットは20から始まる' do
610 r = Scroll.himlist_paginate @other_author, 3, 10
611 r.limit_value.should eq 10
612 r.offset_value.should eq 20
616 describe '一覧取得オプションに於いて' do
619 r.should have(2).items
623 r.has_key?(:scroll_panels).should be_true
625 it 'ストーリーはコマを含んでいる' do
627 r[:scroll_panels].has_key?(:panel).should be_true
631 r.has_key?(:author).should be_true
634 describe 'json一覧出力オプションに於いて' do
636 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
637 @p = FactoryGirl.create :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id
638 @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => @op.id, :picture_id => @p.id
639 @sbt = FactoryGirl.create :speech_balloon_template
640 @scroll = FactoryGirl.create :scroll, :author_id => @author.id, :visible => 1
641 @panel = FactoryGirl.create :panel, :author_id => @author.id, :publish => 1
642 @scroll_panel = FactoryGirl.create :scroll_panel, :author_id => @author.id, :scroll_id => @scroll.id, :panel_id => @panel.id
645 r = Scroll.list.to_json Scroll.list_json_opt
648 i.has_key?('scroll_panels').should be_true
650 it 'ストーリーはコマを含んでいる' do
651 r = Scroll.list.to_json Scroll.list_json_opt
654 s = i['scroll_panels'].first
655 s.has_key?('panel').should be_true
658 r = Scroll.list.to_json Scroll.list_json_opt
661 i.has_key?('author').should be_true
665 describe '単体取得に於いて' do
667 @scroll = FactoryGirl.create :scroll, :author_id => @author.id
669 context 'つつがなく終わるとき' do
670 it '単体取得オプションを利用している' do
671 Scroll.stub(:show_opt).with(any_args).and_return({})
672 Scroll.should_receive(:show_opt).with(any_args).exactly(1)
673 r = Scroll.show @scroll.id, @author
675 it '閲覧許可を問い合わせている' do
676 Scroll.any_instance.stub(:visible?).with(any_args).and_return(true)
677 Scroll.any_instance.should_receive(:visible?).with(any_args).exactly(1)
678 r = Scroll.show @scroll.id, @author
682 c = Scroll.show @scroll.id, @author
685 context '閲覧許可が出なかったとき' do
686 it '403Forbidden例外を返す' do
687 Scroll.any_instance.stub(:visible?).and_return(false)
689 Scroll.show @scroll.id, @author
690 }.should raise_error(ActiveRecord::Forbidden)
693 context '存在しないコミックを開こうとしたとき' do
694 it '404RecordNotFound例外を返す' do
696 Scroll.show 110, @author
697 }.should raise_error(ActiveRecord::RecordNotFound)
702 describe '編集取得に於いて' do
704 @scroll = FactoryGirl.create :scroll, :author_id => @author.id
706 context 'つつがなく終わるとき' do
707 it '単体取得オプションを利用している' do
708 Scroll.stub(:show_opt).with(any_args).and_return({})
709 Scroll.should_receive(:show_opt).with(any_args).exactly(1)
710 r = Scroll.edit @scroll.id, @author
712 it '所持判定を問い合わせている' do
713 Scroll.any_instance.stub(:own?).with(any_args).and_return(true)
714 Scroll.any_instance.should_receive(:own?).with(any_args).exactly(1)
715 r = Scroll.edit @scroll.id, @author
719 Scroll.any_instance.stub(:own?).and_return(true)
720 c = Scroll.edit @scroll.id, @author.id
723 context '他人のコミックを開こうとしたとき' do
724 it '403Forbidden例外を返す' do
725 Scroll.any_instance.stub(:own?).and_return(false)
727 Scroll.edit @scroll.id, @author
728 }.should raise_error(ActiveRecord::Forbidden)
731 context '存在しないコミックを開こうとしたとき' do
732 it '404RecordNotFound例外を返す' do
734 Scroll.edit 110, @author
735 }.should raise_error(ActiveRecord::RecordNotFound)
739 describe '単体取得オプションに於いて' do
740 it 'includeキーを含んでいる' do
742 r.has_key?(:include).should be_true
745 r = Scroll.show_opt[:include]
746 r.should have(2).items
749 r = Scroll.show_opt[:include]
750 r.has_key?(:author).should be_true
753 r = Scroll.show_opt[:include]
754 r.has_key?(:scroll_panels).should be_true
756 it 'ストーリーはコマを含んでいる' do
757 r = Scroll.show_opt[:include]
758 r[:scroll_panels].has_key?(:panel).should be_true
761 describe 'json単体出力オプションに於いて' do
763 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
764 @p = FactoryGirl.create :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id
765 @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => @op.id, :picture_id => @p.id
766 @sbt = FactoryGirl.create :speech_balloon_template
767 @scroll = FactoryGirl.create :scroll, :author_id => @author.id, :visible => 1
768 @panel = FactoryGirl.create :panel, :author_id => @author.id, :publish => 1
769 @scroll_panel = FactoryGirl.create :scroll_panel, :author_id => @author.id, :scroll_id => @scroll.id, :panel_id => @panel.id
772 r = Scroll.show(@scroll.id, @author).to_json Scroll.show_json_opt
775 i.has_key?('scroll_panels').should be_true
777 it 'ストーリーはコマを含んでいる' do
778 r = Scroll.show(@scroll.id, @author).to_json Scroll.show_json_opt
781 s = i['scroll_panels'].first
782 s.has_key?('panel').should be_true
785 r = Scroll.show(@scroll.id, @author).to_json Scroll.show_json_opt
788 i.has_key?('author').should be_true
794 @scroll = FactoryGirl.create :scroll, :author_id => @author.id
795 @panel = FactoryGirl.create :panel, :author_id => @author.id, :publish => 1
796 @scroll_panel = FactoryGirl.create :scroll_panel, :author_id => @author.id, :scroll_id => @scroll.id, :panel_id => @panel.id
797 @other_scroll = FactoryGirl.create :scroll, :author_id => @author.id
798 @other_scroll_panel = FactoryGirl.create :scroll_panel, :author_id => @author.id, :scroll_id => @other_scroll.id, :panel_id => @panel.id
800 context 'つつがなく終わるとき' do
803 r = @scroll.destroy_with_scroll_panel
804 }.should change(Scroll, :count).by(-1)
806 r = Scroll.find @scroll.id
809 it '自身にリンクしているストーリーをすべて削除する' do
811 r = @scroll.destroy_with_scroll_panel
812 }.should change(ScrollPanel, :count).by(-1)
814 r = ScrollPanel.find @scroll_panel.id
818 r = @scroll.destroy_with_scroll_panel
822 context '削除に失敗したとき' do
824 ScrollPanel.any_instance.stub(:destroy).with(any_args).and_return(false)
827 r = @scroll.destroy_with_scroll_panel
832 r = @scroll.destroy_with_scroll_panel
833 }.should_not change(Scroll, :count)
835 r = @scroll.destroy_with_scroll_panel
836 }.should_not change(ScrollPanel, :count)