X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=spec%2Fmodels%2Fpanel_spec.rb;fp=spec%2Fmodels%2Fpanel_spec.rb;h=fd63b140911fe11c8e2887ad6794e2b122b37a03;hp=2b07d604cbc0758b517ddee44fd63ad06de0cd97;hb=2983ab721a7fbeb9568a1b291ce30afc93a10f03;hpb=906ab153f933cd14fc4f7cd76cf45f275558b8d5 diff --git a/spec/models/panel_spec.rb b/spec/models/panel_spec.rb index 2b07d604..fd63b140 100644 --- a/spec/models/panel_spec.rb +++ b/spec/models/panel_spec.rb @@ -11,7 +11,8 @@ describe Panel do @other_user = Factory( :user_yas) @other_author = @other_user.author @other_artist = Factory :artist_yas, :author_id => @other_author.id - + @op = Factory :original_picture, :artist_id => @artist.id, :license_id => @license.id + @rp = Factory :resource_picture, :original_picture_id => @op.id, :license_id => @license.id end describe '検証に於いて' do @@ -55,7 +56,7 @@ describe Panel do @panel = Factory.build :panel, :author_id => @author.id, :comic_id => @comic.id end it 'テストデータの確認' do - @panel.resource_picture_id = 1 + @panel.resource_picture_id = @rp.id @panel.should be_valid end it 'nullなら通る' do @@ -66,10 +67,6 @@ describe Panel do @panel.resource_picture_id = 'a' @panel.should_not be_valid end - it '存在する素材でなければ失敗する' do - @panel.resource_picture_id = 0 - @panel.should_not be_valid - end end context 'widthを検証するとき' do before do @@ -446,11 +443,15 @@ describe Panel do end it 'フキダシを含んでいる' do r = Panel.show_include_opt - r.has_key?(:balloons).should be_true + r.has_key?(:speech_balloons).should be_true end + it 'フキダシはフキダシ枠を含んでいる' do + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:balloons).should be_true + end it 'フキダシはセリフを含んでいる' do r = Panel.show_include_opt - r[:balloons].has_key?(:speeches).should be_true + r[:speech_balloons].has_key?(:speeches).should be_true end it '作家を含んでいる' do r = Panel.show_include_opt @@ -498,12 +499,16 @@ describe Panel do r[:panel_pictures][:resource_picture].has_key?(:license).should be_true end it 'フキダシを含んでいる' do - r = Panel.show_json_include_opt[:include] - r.has_key?(:balloons).should be_true + r = Panel.show_include_opt + r.has_key?(:speech_balloons).should be_true end + it 'フキダシはフキダシ枠を含んでいる' do + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:balloons).should be_true + end it 'フキダシはセリフを含んでいる' do - r = Panel.show_json_include_opt[:include] - r[:balloons].has_key?(:speeches).should be_true + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:speeches).should be_true end it '作家を含んでいる' do r = Panel.show_json_include_opt[:include] @@ -606,12 +611,16 @@ describe Panel do r[:panel_pictures][:resource_picture].has_key?(:license).should be_true end it 'フキダシを含んでいる' do - r = Panel.list_opt[:include] - r.has_key?(:balloons).should be_true + r = Panel.show_include_opt + r.has_key?(:speech_balloons).should be_true end + it 'フキダシはフキダシ枠を含んでいる' do + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:balloons).should be_true + end it 'フキダシはセリフを含んでいる' do - r = Panel.list_opt[:include] - r[:balloons].has_key?(:speeches).should be_true + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:speeches).should be_true end it '作家を含んでいる' do r = Panel.list_opt[:include] @@ -648,12 +657,16 @@ describe Panel do r[:panel_pictures][:resource_picture].has_key?(:license).should be_true end it 'フキダシを含んでいる' do - r = Panel.list_json_opt[:include] - r.has_key?(:balloons).should be_true + r = Panel.show_include_opt + r.has_key?(:speech_balloons).should be_true end + it 'フキダシはフキダシ枠を含んでいる' do + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:balloons).should be_true + end it 'フキダシはセリフを含んでいる' do - r = Panel.list_json_opt[:include] - r[:balloons].has_key?(:speeches).should be_true + r = Panel.show_include_opt + r[:speech_balloons].has_key?(:speeches).should be_true end it '作家を含んでいる' do r = Panel.list_json_opt[:include]