OSDN Git Service

pass test
[pettanr/pettanr.git] / spec / factories.rb
index b654bc6..2f449d2 100644 (file)
@@ -1,7 +1,8 @@
 Factory.define :admin, :class => Admin do |admin|
-  admin.email "admin@gmail.com"
+  admin.sequence(:email) { |n| "admin#{n}@gmail.com"}
   admin.password "admin0100"
   admin.password_confirmation "admin0100"
+  admin.approve 1
 end
 
 Factory.define :user_yas, :class => User do |user|
@@ -25,7 +26,7 @@ end
 
 Factory.define :artist, :class => Artist do |artist|
   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
-  artist.name nil
+  artist.name 'art'
 #  artist.association :author_yas
 end
 
@@ -37,7 +38,7 @@ end
 
 Factory.define :license, :class => License do |license|
   license.name 'peta2.5'
-  license.url 'test'
+  license.url 'http://test.lc/'
   license.cc_by 0
   license.cc_sa 0
   license.cc_nd 0
@@ -48,6 +49,42 @@ Factory.define :license, :class => License do |license|
   license.keep_aspect_ratio 0
 end
 
+Factory.define :common_license, :class => CommonLicense do |license|
+  license.license_id 0
+  license.name 'peta2.1'
+  license.url 'http://test.lc/'
+  license.cc_by 0
+  license.cc_sa 0
+  license.cc_nd 0
+  license.cc_nc 0
+  license.no_resize 0
+  license.no_flip 0
+  license.no_convert 0
+  license.keep_aspect_ratio 0
+end
+
+Factory.define :original_license, :class => OriginalLicense do |license|
+  license.license_id 0
+  license.name 'peta2.1'
+  license.url 'http://test.olc/'
+  license.cc_by 0
+  license.cc_sa 0
+  license.cc_nd 0
+  license.cc_nc 0
+  license.no_resize 0
+  license.no_flip 0
+  license.no_convert 0
+  license.keep_aspect_ratio 0
+end
+
+Factory.define :comic, :class => Comic do |comic|
+  comic.title "comic"
+  comic.width 100
+  comic.height 10
+  comic.visible 3
+  comic.editable 3
+end
+
 Factory.define :normal_comic, :class => Comic do |comic|
   comic.title "normal_comic"
   comic.width 100
@@ -103,32 +140,46 @@ Factory.define :system_picture, :class => SystemPicture do |sp|
   sp.ext 'png'
   sp.width 222
   sp.height 111
-  sp.fileseze 100000
+  sp.filesize 100000
+  sp.md5 '098f6bcd4621d373cade4e832627b4f6'
+end
+
+Factory.define :speech_balloon_template, :class => SpeechBalloonTemplate do |sbt|
+  sbt.name 'Plain@pettanr.com'
+  sbt.classname 'Plain'
+  sbt.caption 'normal fuki'
+  sbt.t 0
+  sbt.settings '{}'
+end
+
+Factory.define :speech_balloon, :class => SpeechBalloon do |sb|
+  sb.panel_id 1
+  sb.speech_balloon_template_id 1
+  sb.classname 'Plain'
+  sb.z 1
+  sb.t 0
+  sb.settings '{}'
 end
 
 Factory.define :balloon, :class => Balloon do |balloon|
-  balloon.panel_id 1
-  balloon.balloon_template_id 1 
+  balloon.speech_balloon_id 1
   balloon.system_picture_id 1 
-  balloon.tail 1 
-  balloon.size 1 
   balloon.x 100
   balloon.y 200
-  balloon.z 1
-  balloon.t 0
   balloon.width 222 
   balloon.height 333 
+  balloon.caption 'test pict'
+  balloon.settings nil
 end
 
-Factory.define :speach, :class => Speach do |speach|
-  speach.balloon_id 1
-  speach.speach_template_id 1
-  speach.content 'test'
-  speach.x 10
-  speach.y 100
-  speach.t 0
-  speach.width 200
-  speach.height 190
+Factory.define :speech, :class => Speech do |speech|
+  speech.speech_balloon_id 1
+  speech.content 'test'
+  speech.x 10
+  speech.y 100
+  speech.width 200
+  speech.height 190
+  speech.settings nil
 end
 
 Factory.define :panel_picture, :class => PanelPicture do |pp|
@@ -145,11 +196,10 @@ end
 
 Factory.define :panel, :class => Panel do |panel|
   panel.comic_id 1
-  panel.resource_picture_id 1
   panel.border 1
-  panel.x 111
-  panel.y 200
-  panel.z 1
+  panel.x nil
+  panel.y nil
+  panel.z nil
   panel.t 0
   panel.width 100
   panel.height 300