1 # -*- encoding: utf-8 -*-
7 FactoryGirl.create :admin
8 @user = FactoryGirl.create( :user_yas)
10 @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
11 @other_user = FactoryGirl.create( :user_yas)
12 @other_author = @other_user.author
13 @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
14 @sp = FactoryGirl.create :system_picture
15 @lg = FactoryGirl.create :license_group
16 @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
17 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
24 it 'オーソドックスなデータなら通る' do
25 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
29 context 'original_picture_idを検証するとき' do
31 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
34 @p.original_picture_id = @op.id
38 @p.original_picture_id = nil
39 @p.should_not be_valid
42 @p.original_picture_id = 'a'
43 @p.should_not be_valid
45 it '存在する原画でなければ失敗する' do
46 @p.original_picture_id = 0
47 @p.should_not be_valid
50 context 'revisionを検証するとき' do
52 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
60 @p.should_not be_valid
64 @p.should_not be_valid
67 context 'extを検証するとき' do
69 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
77 @p.should_not be_valid
81 @p.should_not be_valid
83 it 'png,gif,jpeg以外なら失敗する' do
85 @p.should_not be_valid
88 context 'widthを検証するとき' do
90 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
98 @p.should_not be_valid
102 @p.should_not be_valid
106 @p.should_not be_valid
110 @p.should_not be_valid
113 context 'heightを検証するとき' do
115 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
123 @p.should_not be_valid
127 @p.should_not be_valid
131 @p.should_not be_valid
135 @p.should_not be_valid
138 context 'filesizeを検証するとき' do
140 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
148 @p.should_not be_valid
152 @p.should_not be_valid
156 @p.should_not be_valid
159 @p.filesize = 2000000+1
160 @p.should_not be_valid
163 context 'artist_idを検証するとき' do
165 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
168 @p.artist_id = @artist.id
173 @p.should_not be_valid
177 @p.should_not be_valid
179 it '存在する絵師でなければ失敗する' do
181 @p.should_not be_valid
184 context 'md5を検証するとき' do
186 @p = FactoryGirl.build :picture
189 @p.md5 = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
194 @p.should_not be_valid
198 @p.should_not be_valid
201 context 'license_idを検証するとき' do
203 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
206 @p.license_id = @license.id
211 @p.should_not be_valid
215 @p.should_not be_valid
217 it '存在するライセンスグループでなければ失敗する' do
219 @p.should_not be_valid
222 context 'artist_nameを検証するとき' do
224 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
232 @p.should_not be_valid
235 context 'classnameを検証するとき' do
237 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
240 @p.classname = 'a'*50
245 @p.should_not be_valid
248 @p.classname = 'a'*51
249 @p.should_not be_valid
252 context 'creditを検証するとき' do
254 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
261 context 'settingsを検証するとき' do
263 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
273 describe '最新Revision取得に於いて' do
274 context '初めての原画を公開したとき' do
276 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
278 it 'Revisionは1となる' do
279 @p.new_revision.should eq 1
282 context 'HEADが1のとき' do
284 FactoryGirl.create :picture, :revision => 1, :original_picture_id => @op.id, :license_id => @license.id
285 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
287 it 'Revisionは2となる' do
288 @p.new_revision.should eq 2
291 context 'HEADが5のとき' do
293 FactoryGirl.create :picture, :revision => 1, :original_picture_id => @op.id, :license_id => @license.id
294 FactoryGirl.create :picture, :revision => 5, :original_picture_id => @op.id, :license_id => @license.id
295 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
297 it 'Revisionは6となる' do
298 @p.new_revision.should eq 6
302 describe '素材からのコピーデータセットに於いて' do
304 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
305 attr = {:ext => 'jpeg', :width => 264, :height => 265, :filesize => 266,
306 :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id,
307 :artist_name => 'tester', :classname => 'Tester', :credit => {:title => 'cap'}.to_json.to_s, :settings => {:set => 1}.to_json.to_s}
308 @rp = FactoryGirl.build :resource_picture, attr
309 @p = FactoryGirl.build :picture
311 it '素材オブジェクトから属性を取り出して対象実素材にセットしている' do
312 res = @p.copy_data(@rp)
313 @p.ext.should eq 'jpeg'
314 @p.width.should eq 264
315 @p.height.should eq 265
316 @p.filesize.should eq 266
317 @p.artist_id.should eq @artist.id
318 @p.md5.should eq @rp.md5
319 @p.license_id.should eq @license.id
320 @p.original_picture_id.should eq @op.id
321 @p.artist_name.should eq 'tester'
322 @p.classname.should eq 'Tester'
323 @p.credit.should match /title/
324 @p.settings.should match /set/
328 describe 'md5重複リストに於いて' do
330 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
331 @p = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 0,
332 :original_picture_id => @op.id, :md5 => 'a' * 32
333 @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :picture_id => @p.id
334 @op2 = FactoryGirl.create :original_picture, :artist_id => @artist.id
335 @p2 = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 0,
336 :original_picture_id => @op2.id, :md5 => 'b' * 32
337 @op3 = FactoryGirl.create :original_picture, :artist_id => @artist.id
340 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
341 res.is_a?(Array).should be_true
344 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
345 res.include?(@p2).should be_false
348 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
349 res.empty?.should be_true
351 it '同一原画は旧版でも含まない' do
352 @p3 = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 1,
353 :original_picture_id => @op.id, :md5 => 'a' * 32
354 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
355 res.empty?.should be_true
358 @p3 = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 1,
359 :original_picture_id => @op2.id, :md5 => 'a' * 32
360 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
363 it '他所の原画でもmd5が違えば含まない' do
364 @p3 = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 1,
365 :original_picture_id => @op2.id, :md5 => 'c' * 32
366 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
367 res.empty?.should be_true
370 @p3 = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 1,
371 :original_picture_id => @op2.id, :md5 => 'a' * 32
372 @p4 = FactoryGirl.create :picture, :artist_id => @artist.id, :license_id => @license.id, :revision => 1,
373 :original_picture_id => @op3.id, :md5 => 'a' * 32, :updated_at => Time.now + 100
374 res = Picture.list_by_md5(@p.md5, @p.original_picture_id)
375 res.should eq [@p4, @p3]
379 describe 'md5重複判定に於いて' do
381 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
382 @op2 = FactoryGirl.create :original_picture, :artist_id => @artist.id
383 @p = FactoryGirl.create :picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :revision => 0
384 @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :picture_id => @p.id
386 context '同一原画以外に同じ値があるとき' do
388 @p2 = FactoryGirl.create :picture, :artist_id => @artist.id, :original_picture_id => @op2.id, :license_id => @license.id
391 res = Picture.exist_by_md5(@p.md5, @p.original_picture_id)
395 context '同一原画以外に同じ値がないとき' do
397 res = Picture.exist_by_md5(@p.md5, @p.original_picture_id)
401 context '同一原画に同じ値があるとき' do
403 @p2 = FactoryGirl.create :picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :revision => 1
406 res = Picture.exist_by_md5(@p.md5, @p.original_picture_id)
412 describe 'head判定に於いて' do
415 context '自身とリンクした素材があるとき' do
417 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
418 @p = FactoryGirl.create :picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id
419 @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :picture_id => @p.id
426 context '自身とリンクした素材がないとき' do
428 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
429 @p = FactoryGirl.create :picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :revision => 0
430 @p2 = FactoryGirl.create :picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :revision => 1
431 @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :original_picture_id => @op.id, :license_id => @license.id, :picture_id => @p2.id
443 class Mgk ; class Image ; end ; end
445 Mgk::Image.stub(:from_blob).with(any_args).and_return([Mgk.new])
446 Mgk.any_instance.stub(:format).with(any_args).and_return('png')
447 Mgk.any_instance.stub(:rows).with(any_args).and_return(200)
448 Mgk.any_instance.stub(:columns).with(any_args).and_return(100)
449 Mgk.any_instance.stub(:filesize).with(any_args).and_return(@filesize)
450 Mgk.any_instance.stub(:to_blob).with(any_args).and_return('data')
451 #原画ファイル削除だけは必ず成功するものとしておく
452 PictureIO::LocalPicture.any_instance.stub(:delete).with(any_args).and_return(true)
456 #すべての処理が正常パターンで通過すれば、一番深い分岐まで通る。
457 #それで外部のメソッド呼び出しだけに着目してテストする。
458 Picture.any_instance.stub(:save).with(any_args).and_return(true)
459 Picture.any_instance.stub(:store_picture).with(any_args).and_return(true)
460 Picture.any_instance.stub(:to_gif?).with(any_args).and_return(true)
461 class GifMgk < Mgk ; end #store_pictureは二回呼び出される。区別をつけるために
462 @gifmgk = GifMgk.new #パラメータを二種類用意する。
463 Picture.stub(:png_to_gif).with(any_args).and_return(@gifmgk)
464 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
466 it '最新Revisionを取得している' do
467 Picture.any_instance.should_receive(:new_revision).with(any_args).exactly(1)
468 res = @p.store(Mgk.new)
471 Picture.any_instance.should_receive(:save).with(any_args).exactly(1)
472 res = @p.store(Mgk.new)
474 it '画像ファイルの作成機能で画像を保存している' do
475 mgk = Mgk.new #一回目の本画像保存は与えたオブジェクトを使って保存する。
476 Picture.any_instance.stub(:filename).with(any_args).and_return('1.png')
477 Picture.any_instance.should_receive(:store_picture).with(mgk, '1.png').exactly(1)
480 it '自身にgifフォーマット変換対象かを問い合わせている' do
481 Picture.any_instance.should_receive(:to_gif?).with(any_args).exactly(1)
482 res = @p.store(Mgk.new)
484 it '自身にGifフォーマット変換を依頼している' do
485 Picture.should_receive(:png_to_gif).with(any_args).exactly(1)
486 res = @p.store(Mgk.new)
488 it '画像ファイルの作成機能でgif画像を保存している' do
490 Picture.any_instance.stub(:gifname).with(any_args).and_return('1.gif')
491 Picture.any_instance.should_receive(:store_picture).with(@gifmgk, '1.gif').exactly(1)
492 res = @p.store(Mgk.new)
495 context 'つつがなく終わるとき' do
497 #すべての処理を正常パターンで通過させ、保存機能をチェックする。
498 # Picture.any_instance.stub(:save).with(any_args).and_return(true)
499 Picture.any_instance.stub(:store_picture).with(any_args).and_return(true)
500 Picture.any_instance.stub(:to_gif?).with(any_args).and_return(true)
501 class GifMgk < Mgk ; end #store_pictureは二回呼び出される。区別をつけるために
502 @gifmgk = GifMgk.new #パラメータを二種類用意する。
503 Picture.stub(:png_to_gif).with(any_args).and_return(@gifmgk)
504 @p = FactoryGirl.build :picture, :revision => nil, :original_picture_id => @op.id, :license_id => @license.id
507 res = @p.store(Mgk.new)
510 it 'Revisionに最新Revisionセット' do
511 res = @p.store(Mgk.new)
512 @p.revision.should eq 1
516 res = @p.store(Mgk.new)
517 }.should change Picture, :count
520 context 'gif変換なしで、つつがなく終わるとき' do
522 #すべての処理を正常パターンで通過させ、保存機能をチェックする。
523 Picture.any_instance.stub(:save).with(any_args).and_return(true)
524 Picture.any_instance.stub(:store_picture).with(any_args).and_return(true)
525 Picture.any_instance.stub(:to_gif?).with(any_args).and_return(false)
526 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
529 res = @p.store(Mgk.new)
532 it 'gif保存は呼ばれていない' do
533 #二回目の画像作成が呼び出されないで1回こっきりならgif保存は呼ばれていないんだろう。
534 Picture.any_instance.should_receive(:store_picture).with(any_args).exactly(1)
535 res = @p.store(Mgk.new)
538 #以下から例外ケース。処理先頭から失敗させていく
539 context '自身の保存に失敗したとき' do
541 Picture.any_instance.stub(:save).with(any_args).and_return(false)
542 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
545 res = @p.store(Mgk.new)
550 @p.should be_a_new Picture
553 context '画像の保存に失敗したとき' do
555 Picture.any_instance.stub(:save).with(any_args).and_return(true)
556 Picture.any_instance.stub(:store_picture).with(any_args).and_return(false)
557 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
560 res = @p.store(Mgk.new)
563 it 'gif変換判定は呼ばれていない' do
564 Picture.any_instance.should_not_receive(:to_gif?).with(any_args)
565 res = @p.store(Mgk.new)
568 context 'gif変換に失敗したとき' do
570 Picture.any_instance.stub(:save).with(any_args).and_return(true)
571 Picture.any_instance.stub(:store_picture).with(any_args).and_return(true)
572 Picture.any_instance.stub(:to_gif?).with(any_args).and_return(true)
573 Picture.stub(:png_to_gif).with(any_args).and_return(false)
574 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
577 res = @p.store(Mgk.new)
580 it 'gif画像の保存は呼ばれていない' do
582 Picture.any_instance.should_receive(:store_picture).with(any_args).exactly(1)
583 res = @p.store(Mgk.new)
586 context 'gif画像の保存に失敗したとき' do
589 Picture.any_instance.stub(:filename).with(any_args).and_return('1.png')
590 Picture.any_instance.stub(:gifname).with(any_args).and_return('1.gif')
591 Picture.any_instance.stub(:save).with(any_args).and_return(true)
592 Picture.any_instance.stub(:store_picture).with(@mgk, '1.png').and_return(true)
593 Picture.any_instance.stub(:to_gif?).with(any_args).and_return(true)
594 class GifMgk < Mgk ; end #store_pictureは二回呼び出される。区別をつけるために
595 @gifmgk = GifMgk.new #パラメータを二種類用意する。
596 Picture.stub(:png_to_gif).with(any_args).and_return(@gifmgk)
597 Picture.any_instance.stub(:store_picture).with(@gifmgk, '1.gif').and_return(false)
598 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
607 describe '反転画像の保存先に於いて' do
609 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
612 it 'ベースディレクトリだけを返す' do
613 Picture.any_instance.should_receive(:flag_reverse).with(any_args).and_return(-1)
615 r.should have(1).item
617 it 'ベースディレクトリだけを返す' do
618 Picture.any_instance.should_receive(:flag_reverse).with(any_args).and_return(-1)
624 it 'ベースディレクトリと反転3種を返す' do
625 Picture.any_instance.should_receive(:flag_reverse).with(any_args).and_return(1)
627 r.should have(4).item
629 it 'ベースディレクトリと反転3種を返す' do
630 Picture.any_instance.should_receive(:flag_reverse).with(any_args).and_return(1)
632 r.last.should eq 'vh'
637 describe '画像ファイルの作成に於いて' do
638 #PictureIo経由で画像を保存するための機能。ファイル名に自身のidを使うので事前に自身の保存が必要。
641 class Mgk ; class Image ; end ; end
643 Mgk::Image.stub(:from_blob).with(any_args).and_return([Mgk.new])
644 Mgk.any_instance.stub(:format).with(any_args).and_return('png')
645 Mgk.any_instance.stub(:rows).with(any_args).and_return(200)
646 Mgk.any_instance.stub(:columns).with(any_args).and_return(100)
647 Mgk.any_instance.stub(:filesize).with(any_args).and_return(@filesize)
648 Mgk.any_instance.stub(:to_blob).with(any_args).and_return('data')
649 #原画ファイル削除だけは必ず成功するものとしておく
650 PictureIO::LocalPicture.any_instance.stub(:delete).with(any_args).and_return(true)
652 Picture.any_instance.stub(:subdirs).with(any_args).and_return(['', 'v', 'h', 'vh'])
653 Picture.any_instance.stub(:h).with(any_args).and_return('data')
654 Picture.any_instance.stub(:v).with(any_args).and_return('data')
655 Picture.any_instance.stub(:vh).with(any_args).and_return('data')
656 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id
660 #すべての処理を正常パターンで通過させ、保存機能をチェックする。
661 PictureIO.picture_io.stub(:put).with(any_args).and_return(true)
663 it '画像ファイルの保存が4回呼ばれる' do
664 PictureIO.picture_io.should_receive(:put).with(any_args).exactly(4)
665 res = @p.store_picture(Mgk.new, '1.png')
667 it '画像ファイルのベースへの保存が1回呼ばれる' do
668 PictureIO.picture_io.should_receive(:put).with('data', '1.png', '').exactly(1)
669 res = @p.store_picture(Mgk.new, '1.png')
671 it '画像ファイルの垂直反転への保存が1回呼ばれる' do
672 PictureIO.picture_io.should_receive(:put).with('data', '1.png', 'v').exactly(1)
673 res = @p.store_picture(Mgk.new, '1.png')
675 it '画像ファイルの水平反転への保存が1回呼ばれる' do
676 PictureIO.picture_io.should_receive(:put).with('data', '1.png', 'h').exactly(1)
677 res = @p.store_picture(Mgk.new, '1.png')
679 it '画像ファイルの垂直水平反転への保存が1回呼ばれる' do
680 PictureIO.picture_io.should_receive(:put).with('data', '1.png', 'vh').exactly(1)
681 res = @p.store_picture(Mgk.new, '1.png')
684 Picture.any_instance.should_receive(:v).with(any_args).exactly(1)
685 res = @p.store_picture(Mgk.new, '1.png')
688 Picture.any_instance.should_receive(:h).with(any_args).exactly(1)
689 res = @p.store_picture(Mgk.new, '1.png')
691 it '垂直水平反転が1回呼ばれる' do
692 Picture.any_instance.should_receive(:vh).with(any_args).exactly(1)
693 res = @p.store_picture(Mgk.new, '1.png')
696 context 'つつがなく終わるとき' do
698 #すべての処理を正常パターンで通過させ、保存機能をチェックする。
699 PictureIO.picture_io.stub(:put).with(any_args).and_return(true)
702 res = @p.store_picture(Mgk.new, '1.png')
708 PictureIO.picture_io.stub(:put).with(any_args).and_return(false)
711 res = @p.store_picture(Mgk.new, '1.png')
718 describe 'フラグ展開に於いて' do
720 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id,
721 :settings => "{\"open\": 1, \"commercial\": 2, \"official\": 3, \"attribution\": 4, \"derive\": 5, \"thumbnail\": 6, \"gif_convert\": 7, \"reverse\": 8, \"resize\": 9, \"sync_vh\": 10, \"overlap\": 11}"
723 context 'json展開チェック' do
724 it '展開してなければ展開して@flagsに保管する' do
725 @p.flags.should_not be_nil
729 @p.flags.is_a?(Hash).should be_true
730 @p.flags.empty?.should be_true
733 context 'openについて' do
734 it '@flag_openに保管する' do
735 @p.flag_open.should_not be_nil
737 it '本当にフラグHashからじゃなく、変数から取得してる?' do
740 @p.flag_open.should_not be_nil
743 @p.flag_open.should eq 1
746 context 'commercialについて' do
747 it '@flag_commercialに保管する' do
748 @p.flag_commercial.should_not be_nil
750 it '本当にフラグHashからじゃなく、変数から取得してる?' do
753 @p.flag_commercial.should_not be_nil
756 @p.flag_commercial.should eq 2
759 context 'officialについて' do
760 it '@flag_officialに保管する' do
761 @p.flag_official.should_not be_nil
763 it '本当にフラグHashからじゃなく、変数から取得してる?' do
766 @p.flag_official.should_not be_nil
769 @p.flag_official.should eq 3
772 context 'attributionについて' do
773 it '@flag_attributionに保管する' do
774 @p.flag_attribution.should_not be_nil
776 it '本当にフラグHashからじゃなく、変数から取得してる?' do
779 @p.flag_attribution.should_not be_nil
782 @p.flag_attribution.should eq 4
785 context 'deriveについて' do
786 it '@flag_deriveに保管する' do
787 @p.flag_derive.should_not be_nil
789 it '本当にフラグHashからじゃなく、変数から取得してる?' do
792 @p.flag_derive.should_not be_nil
795 @p.flag_derive.should eq 5
798 context 'thumbnailについて' do
799 it '@flag_thumbnailに保管する' do
800 @p.flag_thumbnail.should_not be_nil
802 it '本当にフラグHashからじゃなく、変数から取得してる?' do
805 @p.flag_thumbnail.should_not be_nil
808 @p.flag_thumbnail.should eq 6
811 context 'gif_convertについて' do
812 it '@flag_gif_convertに保管する' do
813 @p.flag_gif_convert.should_not be_nil
815 it '本当にフラグHashからじゃなく、変数から取得してる?' do
818 @p.flag_gif_convert.should_not be_nil
821 @p.flag_gif_convert.should eq 7
824 context 'reverseについて' do
825 it '@flag_reverseに保管する' do
826 @p.flag_reverse.should_not be_nil
828 it '本当にフラグHashからじゃなく、変数から取得してる?' do
831 @p.flag_reverse.should_not be_nil
834 @p.flag_reverse.should eq 8
837 context 'resizeについて' do
838 it '@flag_resizeに保管する' do
839 @p.flag_resize.should_not be_nil
841 it '本当にフラグHashからじゃなく、変数から取得してる?' do
844 @p.flag_resize.should_not be_nil
847 @p.flag_resize.should eq 9
850 context 'sync_vhについて' do
851 it '@flag_sync_vhに保管する' do
852 @p.flag_sync_vh.should_not be_nil
854 it '本当にフラグHashからじゃなく、変数から取得してる?' do
857 @p.flag_sync_vh.should_not be_nil
860 @p.flag_sync_vh.should eq 10
863 context 'overlapについて' do
864 it '@flag_overlapに保管する' do
865 @p.flag_overlap.should_not be_nil
867 it '本当にフラグHashからじゃなく、変数から取得してる?' do
870 @p.flag_overlap.should_not be_nil
873 @p.flag_overlap.should eq 11
878 describe 'クレジットデータに於いて' do
880 @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
881 @p = FactoryGirl.build :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id, :credit => '{"system_picture_id": 2}'
883 it 'system_picture_idが入っている' do
885 res["system_picture_id"].should eq 2