1 # -*- encoding: utf-8 -*-
\r
3 require 'spec_helper'
\r
7 @admin = FactoryGirl.create :admin
\r
8 @user = FactoryGirl.create( :user_yas)
\r
9 @author = FactoryGirl.create :author, :user_id => @user.id
\r
10 @other_user = FactoryGirl.create( :user_yas)
\r
11 @other_author = FactoryGirl.create :author, :user_id => @other_user.id
\r
12 @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
\r
13 @sp = FactoryGirl.create :system_picture
\r
14 @lg = FactoryGirl.create :license_group
\r
15 @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
\r
17 @writing_format = FactoryGirl.create :writing_format
\r
18 @speech_balloon_template = FactoryGirl.create :speech_balloon_template, "name" => "circle@pettan.com", "classname" => "CircleSpeechBalloon", "caption" => "cc", "system_picture_id" => @sp.id, "settings" => '{}'
\r
19 @panel = FactoryGirl.create :panel, :author_id => @author.id
\r
22 describe '検証に於いて' do
\r
24 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
25 @speech = @sb.build_speech(
\r
26 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
28 @balloon = @sb.build_balloon(
\r
29 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
35 context 'オーソドックスなデータのとき' do
\r
37 @speech.font_size = 1.0
\r
38 @speech.text_align = 0
\r
39 @speech.fore_color = 0
\r
45 @speech.should be_valid
\r
48 @speech.font_size = 99999.0
\r
49 @speech.text_align = 3
\r
50 @speech.fore_color = 0xffffff
\r
53 @speech.width = 99999
\r
54 @speech.height = 99999
\r
55 @speech.quotes = '[ ] [ ] [ ] [ ]'
\r
56 @speech.should be_valid
\r
60 context 'speech_balloon_idを検証するとき' do
\r
61 #ネストの保存はnilを許可しなければならないので数値チェックだけ
\r
63 @speech.speech_balloon_id = @sb.id
\r
64 @speech.should be_valid
\r
67 @speech.speech_balloon_id = 'a'
\r
68 @speech.should_not be_valid
\r
71 context 'contentを検証するとき' do
\r
73 context 'font_sizeを検証するとき' do
\r
75 @speech.font_size = nil
\r
76 @speech.should_not be_valid
\r
79 @speech.font_size = 'a'
\r
80 @speech.should_not be_valid
\r
83 @speech.font_size = '0'
\r
84 @speech.should be_valid
\r
87 @speech.font_size = '0'
\r
88 @speech.should be_valid
\r
91 @speech.font_size = 10.5
\r
92 @speech.should be_valid
\r
95 context 'text_alignを検証するとき' do
\r
97 @speech.text_align = nil
\r
98 @speech.should_not be_valid
\r
100 it '数値でなければ失敗する' do
\r
101 @speech.text_align = 'a'
\r
102 @speech.should_not be_valid
\r
105 @speech.text_align = '0'
\r
106 @speech.should be_valid
\r
109 @speech.text_align = -1
\r
110 @speech.should_not be_valid
\r
113 @speech.text_align = 4
\r
114 @speech.should_not be_valid
\r
117 context 'fore_colorを検証するとき' do
\r
119 @speech.fore_color = nil
\r
120 @speech.should_not be_valid
\r
122 it '数値でなければ失敗する' do
\r
123 @speech.fore_color = 'a'
\r
124 @speech.should_not be_valid
\r
127 @speech.fore_color = '0'
\r
128 @speech.should be_valid
\r
131 @speech.fore_color = -1
\r
132 @speech.should_not be_valid
\r
134 it '24bit colorでなければ失敗する' do
\r
135 @speech.fore_color = 0x1000000
\r
136 @speech.should_not be_valid
\r
139 context 'xを検証するとき' do
\r
142 @speech.should_not be_valid
\r
144 it '数値でなければ失敗する' do
\r
146 @speech.should_not be_valid
\r
150 @speech.should be_valid
\r
154 @speech.should be_valid
\r
157 context 'yを検証するとき' do
\r
160 @speech.should_not be_valid
\r
162 it '数値でなければ失敗する' do
\r
164 @speech.should_not be_valid
\r
168 @speech.should be_valid
\r
172 @speech.should be_valid
\r
175 context 'widthを検証するとき' do
\r
177 @speech.width = nil
\r
178 @speech.should_not be_valid
\r
180 it '数値でなければ失敗する' do
\r
181 @speech.width = 'a'
\r
182 @speech.should_not be_valid
\r
185 @speech.width = '0'
\r
186 @speech.should_not be_valid
\r
190 @speech.should_not be_valid
\r
193 context 'heightを検証するとき' do
\r
195 @speech.height = nil
\r
196 @speech.should_not be_valid
\r
198 it '数値でなければ失敗する' do
\r
199 @speech.height = 'a'
\r
200 @speech.should_not be_valid
\r
203 @speech.height = '0'
\r
204 @speech.should_not be_valid
\r
207 @speech.height = -1
\r
208 @speech.should_not be_valid
\r
211 context 'quotesを検証するとき' do
\r
213 @speech.quotes = '[ ] ['
\r
214 @speech.should_not be_valid
\r
216 it '16文字以上なら失敗する' do
\r
217 @speech.quotes = '[ ] [ ] [ ] [ ] [ ]'
\r
218 @speech.should_not be_valid
\r
221 context 'settingsを検証するとき' do
\r
225 describe '文字コード検証に於いて' do
\r
227 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
228 @speech = @sb.build_speech(
\r
229 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
231 @balloon = @sb.build_balloon(
\r
232 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
238 context 'contentを検証するとき' do
\r
239 it 'Shift JISなら失敗する' do
\r
240 @speech.content = "\x83G\x83r\x83]\x83D"
\r
242 @speech.valid_encode
\r
243 }.should raise_error(Pettanr::BadRequest)
\r
247 context 'quotesを検証するとき' do
\r
248 it 'Shift JISなら失敗する' do
\r
249 @speech.quotes = "\x83G \x83r \x83 ]\x83D"
\r
251 @speech.valid_encode
\r
252 }.should raise_error(Pettanr::BadRequest)
\r
256 context 'settingsを検証するとき' do
\r
257 it 'Shift JISなら失敗する' do
\r
258 @speech.settings = "\x83G\x83r\x83]\x83D"
\r
260 @speech.valid_encode
\r
261 }.should raise_error(Pettanr::BadRequest)
\r
266 describe '閲覧許可に於いて' do
\r
268 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
269 @speech = @sb.build_speech(
\r
270 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
272 @balloon = @sb.build_balloon(
\r
273 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
278 context 'オープンモードのとき' do
\r
280 MagicNumber['run_mode'] = 0
\r
282 it '自身にゲスト用ロールチェックを問い合わせしている' do
\r
283 Speech.any_instance.stub(:guest_role_check).and_return(true)
\r
284 Speech.any_instance.should_receive(:guest_role_check).with(any_args).exactly(1)
\r
285 r = @speech.visible?([@author])
\r
287 it 'ゲスト用ロールチェックが失敗したとき、falseを返す' do
\r
288 Speech.any_instance.stub(:guest_role_check).and_return(false)
\r
289 r = @speech.visible?([@author])
\r
293 context 'クローズドモードのとき' do
\r
295 MagicNumber['run_mode'] = 1
\r
297 it '自身に読者用ロールチェックを問い合わせしている' do
\r
298 Speech.any_instance.stub(:reader_role_check).and_return(true)
\r
299 Speech.any_instance.should_receive(:reader_role_check).with(any_args).exactly(1)
\r
300 r = @speech.visible?([@author])
\r
302 it '読者用ロールチェックが失敗したとき、falseを返す' do
\r
303 Speech.any_instance.stub(:reader_role_check).and_return(false)
\r
304 r = @speech.visible?([@author])
\r
308 context '事前チェックする' do
\r
310 MagicNumber['run_mode'] = 1
\r
311 Speech.any_instance.stub(:reader_role_check).and_return(true)
\r
313 it '自身のコマに所持判定を問い合わせしている' do
\r
314 Panel.any_instance.stub(:own?).and_return(true)
\r
315 Panel.any_instance.should_receive(:own?).with(any_args).exactly(1)
\r
316 r = @speech.visible?([@author])
\r
318 it '自身のコマに閲覧許可を問い合わせしている' do
\r
319 Panel.any_instance.stub(:own?).and_return(false)
\r
320 Panel.any_instance.stub(:visible?).and_return(true)
\r
321 Panel.any_instance.should_receive(:visible?).with(any_args).exactly(1)
\r
322 r = @speech.visible?([@author])
\r
325 context 'つつがなく終わるとき' do
\r
327 MagicNumber['run_mode'] = 1
\r
328 Panel.any_instance.stub(:reader_role_check).and_return(true)
\r
330 it '自分のコマのセリフなら許可する' do
\r
331 Panel.any_instance.stub(:own?).and_return(true)
\r
332 Panel.any_instance.stub(:visible?).and_return(false)
\r
333 r = @speech.visible?([@author])
\r
336 it '他人の非公開コマのセリフなら許可しない' do
\r
337 Panel.any_instance.stub(:own?).and_return(false)
\r
338 Panel.any_instance.stub(:visible?).and_return(false)
\r
339 r = @speech.visible?([@author])
\r
342 it '他人のコマのセリフでも公開なら許可する' do
\r
343 Panel.any_instance.stub(:own?).and_return(false)
\r
344 Panel.any_instance.stub(:visible?).and_return(true)
\r
345 r = @speech.visible?([@author])
\r
351 describe '一覧取得に於いて' do
\r
353 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
354 @speech = @sb.build_speech(
\r
355 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
357 @balloon = @sb.build_balloon(
\r
358 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
363 context 'page補正について' do
\r
364 it '文字列から数値に変換される' do
\r
365 Speech.page('8').should eq 8
\r
367 it 'nilの場合は1になる' do
\r
368 Speech.page().should eq 1
\r
370 it '0以下の場合は1になる' do
\r
371 Speech.page('0').should eq 1
\r
374 context 'page_size補正について' do
\r
375 it '文字列から数値に変換される' do
\r
376 Speech.page_size('7').should eq 7
\r
378 it 'nilの場合はSpeech.default_page_sizeになる' do
\r
379 Speech.page_size().should eq Speech.default_page_size
\r
381 it '0以下の場合はSpeech.default_page_sizeになる' do
\r
382 Speech.page_size('0').should eq Speech.default_page_size
\r
384 it 'Speech.max_page_sizeを超えた場合はSpeech.max_page_sizeになる' do
\r
385 Speech.page_size('1000').should eq Speech.max_page_size
\r
388 context 'つつがなく終わるとき' do
\r
389 it '一覧取得オプションを利用している' do
\r
390 Speech.stub(:list_opt).with(any_args).and_return({:include => {:speech_balloon => {:panel => {}}}})
\r
391 Speech.should_receive(:list_opt).with(any_args).exactly(1)
\r
397 r.should eq [@speech]
\r
400 #公開されたコマのセリフは(他人のセリフであっても)含んでいる
\r
401 hc = FactoryGirl.create :panel, :author_id => @other_author.id, :publish => 1
\r
402 nsb = FactoryGirl.build :speech_balloon, :panel_id => hc.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
403 npl = nsb.build_speech(
\r
404 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id, :updated_at => Time.now + 100)
\r
407 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
412 r.should eq [npl, @speech]
\r
414 it '非公開のコマのセリフは自分のセリフであっても含まない' do
\r
415 hc = FactoryGirl.create :panel, :author_id => @author.id, :publish => 0
\r
416 nsb = FactoryGirl.build :speech_balloon, :panel_id => hc.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
417 npl = nsb.build_speech(
\r
418 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id, :updated_at => Time.now + 100)
\r
421 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
426 pl.should eq [@speech]
\r
428 context 'DBに5件あって1ページの件数を2件に変えたとして' do
\r
430 @sb2 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
431 @speech2 = @sb2.build_speech(
\r
432 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
434 @balloon2 = @sb2.build_balloon(
\r
435 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 100)
\r
439 @sb3 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
440 @speech3 = @sb3.build_speech(
\r
441 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
443 @balloon3 = @sb3.build_balloon(
\r
444 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 200)
\r
448 @sb4 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
449 @speech4 = @sb4.build_speech(
\r
450 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
452 @balloon4 = @sb4.build_balloon(
\r
453 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 300)
\r
457 @sb5 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
458 @speech5 = @sb5.build_speech(
\r
459 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
461 @balloon5 = @sb5.build_balloon(
\r
462 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 400)
\r
466 Speech.stub(:default_page_size).and_return(2)
\r
470 pl.should have(2).items
\r
472 it 'page=1なら末尾2件を返す' do
\r
474 pl = Speech.list(1)
\r
475 pl.should eq [@speech5, @speech4]
\r
477 it 'page=2なら中間2件を返す' do
\r
478 pl = Speech.list(2)
\r
479 pl.should eq [@speech3, @speech2]
\r
481 it 'page=3なら先頭1件を返す' do
\r
482 pl = Speech.list(3)
\r
483 pl.should eq [@speech]
\r
486 context 'DBに5件あって1ページの件数を0件に変えたとして' do
\r
488 @sb2 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
489 @speech2 = @sb2.build_speech(
\r
490 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
492 @balloon2 = @sb2.build_balloon(
\r
493 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 100)
\r
497 @sb3 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
498 @speech3 = @sb3.build_speech(
\r
499 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
501 @balloon3 = @sb3.build_balloon(
\r
502 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 200)
\r
506 @sb4 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
507 @speech4 = @sb4.build_speech(
\r
508 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
510 @balloon4 = @sb4.build_balloon(
\r
511 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 300)
\r
515 @sb5 = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
516 @speech5 = @sb5.build_speech(
\r
517 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
519 @balloon5 = @sb5.build_balloon(
\r
520 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id, :updated_at => Time.now + 400)
\r
524 Speech.stub(:default_page_size).and_return(2)
\r
526 it '通常は全件(5件)を返す' do
\r
527 r = Speech.list 5, 0
\r
528 r.should have(5).items
\r
532 describe '一覧取得オプションに於いて' do
\r
533 it 'includeキーを含んでいる' do
\r
534 r = Speech.list_opt
\r
535 r.has_key?(:include).should be_true
\r
537 it '1つの項目を含んでいる' do
\r
538 r = Speech.list_opt[:include]
\r
539 r.should have(1).items
\r
542 r = Speech.list_opt[:include]
\r
543 r.has_key?(:speech_balloon).should be_true
\r
545 it 'フキダシはコマを含んでいる' do
\r
546 r = Speech.list_opt[:include]
\r
547 r[:speech_balloon].has_key?(:panel).should be_true
\r
549 it 'コマは作家を含んでいる' do
\r
550 r = Speech.list_opt[:include]
\r
551 r[:speech_balloon][:panel].has_key?(:author).should be_true
\r
553 it 'フキダシはフキダシ枠を含んでいる' do
\r
554 r = Speech.list_opt[:include]
\r
555 r[:speech_balloon].has_key?(:balloon).should be_true
\r
557 it 'フキダシはフキダシテンプレートを含んでいる' do
\r
558 r = Speech.list_opt[:include]
\r
559 r[:speech_balloon].has_key?(:speech_balloon_template).should be_true
\r
562 describe 'json一覧出力オプションに於いて' do
\r
564 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
565 @speech = @sb.build_speech(
\r
566 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
568 @balloon = @sb.build_balloon(
\r
569 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
575 r = Speech.list.to_json Speech.list_json_opt
\r
578 i.has_key?('speech_balloon').should be_true
\r
580 it 'フキダシはコマを含んでいる' do
\r
581 r = Speech.list.to_json Speech.list_json_opt
\r
584 s = i['speech_balloon']
\r
585 s.has_key?('panel').should be_true
\r
587 it 'コマは作家を含んでいる' do
\r
588 r = Speech.list.to_json Speech.list_json_opt
\r
591 s = i['speech_balloon']['panel']
\r
592 s.has_key?('author').should be_true
\r
594 it 'フキダシはフキダシ枠を含んでいる' do
\r
595 r = Speech.list.to_json Speech.list_json_opt
\r
598 s = i['speech_balloon']
\r
599 s.has_key?('balloon').should be_true
\r
601 it 'フキダシはフキダシテンプレートを含んでいる' do
\r
602 r = Speech.list.to_json Speech.list_json_opt
\r
605 s = i['speech_balloon']
\r
606 s.has_key?('speech_balloon_template').should be_true
\r
610 describe '単体取得に於いて' do
\r
612 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
613 @speech = @sb.build_speech(
\r
614 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
616 @balloon = @sb.build_balloon(
\r
617 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
622 context 'つつがなく終わるとき' do
\r
623 it '単体取得オプションを利用している' do
\r
624 Speech.stub(:show_opt).with(any_args).and_return({:include => {:speech_balloon => {:panel => {}}}})
\r
625 Speech.should_receive(:show_opt).with(any_args).exactly(1)
\r
626 r = Speech.show @speech.id, @author
\r
628 it '閲覧許可を問い合わせている' do
\r
629 Speech.any_instance.stub(:visible?).with(any_args).and_return(true)
\r
630 Speech.any_instance.should_receive(:visible?).with(any_args).exactly(1)
\r
631 r = Speech.show @speech.id, @author
\r
635 Speech.any_instance.stub(:visible?).and_return(true)
\r
636 pl = Speech.show @speech.id, @author
\r
637 pl.should eq @speech
\r
639 context '閲覧許可が出なかったとき' do
\r
640 it '403Forbidden例外を返す' do
\r
641 Speech.any_instance.stub(:visible?).and_return(false)
\r
643 Speech.show @speech.id, @author
\r
644 }.should raise_error(ActiveRecord::Forbidden)
\r
647 context '存在しないセリフを開こうとしたとき' do
\r
648 it '404RecordNotFound例外を返す' do
\r
650 Speech.show 110, @author
\r
651 }.should raise_error(ActiveRecord::RecordNotFound)
\r
655 describe '単体取得オプションに於いて' do
\r
656 it 'includeキーを含んでいる' do
\r
657 r = Speech.show_opt
\r
658 r.has_key?(:include).should be_true
\r
660 it '1つの項目を含んでいる' do
\r
661 r = Speech.show_opt[:include]
\r
662 r.should have(1).items
\r
665 r = Speech.show_opt[:include]
\r
666 r.has_key?(:speech_balloon).should be_true
\r
668 it 'フキダシはコマを含んでいる' do
\r
669 r = Speech.show_opt[:include]
\r
670 r[:speech_balloon].has_key?(:panel).should be_true
\r
672 it 'コマは作家を含んでいる' do
\r
673 r = Speech.show_opt[:include]
\r
674 r[:speech_balloon][:panel].has_key?(:author).should be_true
\r
676 it 'フキダシはフキダシ枠を含んでいる' do
\r
677 r = Speech.show_opt[:include]
\r
678 r[:speech_balloon].has_key?(:balloon).should be_true
\r
680 it 'フキダシはフキダシテンプレートを含んでいる' do
\r
681 r = Speech.show_opt[:include]
\r
682 r[:speech_balloon].has_key?(:speech_balloon_template).should be_true
\r
685 describe 'json単体出力オプションに於いて' do
\r
687 @sb = FactoryGirl.build :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
688 @speech = @sb.build_speech(
\r
689 FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
\r
691 @balloon = @sb.build_balloon(
\r
692 FactoryGirl.attributes_for(:balloon, :system_picture_id => @sp.id)
\r
698 r = Speech.show(@speech.id, @author).to_json Speech.show_json_opt
\r
701 i.has_key?('speech_balloon').should be_true
\r
704 r = Speech.show(@speech.id, @author).to_json Speech.show_json_opt
\r
706 i = j['speech_balloon']
\r
707 i.has_key?('panel').should be_true
\r
709 it 'コマは作家を含んでいる' do
\r
710 r = Speech.show(@speech.id, @author).to_json Speech.show_json_opt
\r
712 i = j['speech_balloon']
\r
714 s.has_key?('author').should be_true
\r
716 it 'フキダシ枠を含んでいる' do
\r
717 r = Speech.show(@speech.id, @author).to_json Speech.show_json_opt
\r
719 i = j['speech_balloon']
\r
720 i.has_key?('balloon').should be_true
\r
722 it 'フキダシテンプレートを含んでいる' do
\r
723 r = Speech.show(@speech.id, @author).to_json Speech.show_json_opt
\r
725 i = j['speech_balloon']
\r
726 i.has_key?('speech_balloon_template').should be_true
\r