OSDN Git Service

fix:error dlg
[pettanr/pettanr.git] / spec / factories.rb
index 18cb73b..1a66ab1 100644 (file)
@@ -1,3 +1,5 @@
+# -*- encoding: utf-8 -*-
+#テストデータ
 FactoryGirl.define do
   factory :admin, :class => Admin do |admin|
     admin.sequence(:email) { |n| "admin#{n}@gmail.com"}
@@ -13,8 +15,15 @@ FactoryGirl.define do
   #  user.author FactoryGirl.create(:author_yas)
   end
 
+  factory :demand_user, :class => DemandUser do |demand_user|
+    demand_user.sequence(:email) { |n| "hoge#{n}@gmail.com"}
+    demand_user.password "user0100"
+    demand_user.password_confirmation "user0100"
+  #  user.author FactoryGirl.create(:author_yas)
+  end
+
   factory :author, :class => Author do |author|
-    author.name nil
+    author.name 'test'
     author.sequence(:user_id) { |n| n}
   end
 
@@ -52,39 +61,66 @@ FactoryGirl.define do
     license.system_picture_id 1
   end
 
-  factory :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 :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
+  factory :writing_format, :class => WritingFormat do |writing_format|
+    writing_format.name 'simple_format@pettan.com'
+    writing_format.classname 'SimpleFormat'
+    writing_format.caption 'sl'
+    writing_format.system_picture_id 1 
+    writing_format.settings '{}'
+  end
+
+  factory :scroll, :class => Scroll do |scroll|
+    scroll.title "scroll"
+    scroll.description 'scroll description'
+    scroll.visible 1
+    scroll.author_id 1
+  end
+
+  factory :scroll_panel, :class => ScrollPanel do |scroll_panel|
+    scroll_panel.scroll_id 1
+    scroll_panel.panel_id 1
+    scroll_panel.author_id 1
+    scroll_panel.t 0
   end
 
   factory :comic, :class => Comic do |comic|
     comic.title "comic"
-    comic.width 100
-    comic.height 10
-    comic.visible 3
+    comic.description 'comic description'
+    comic.visible 1
+    comic.author_id 1
+  end
+
+  factory :story, :class => Story do |story|
+    story.comic_id 1
+    story.title "scroll"
+    story.description 'scroll description'
+    story.visible 1
+    story.t 0
+  end
+
+  factory :story_sheet, :class => StorySheet do |story_sheet|
+    story_sheet.sheet_id 1
+    story_sheet.story_id 1
+    story_sheet.t 0
+    story_sheet.author_id 1
+  end
+
+  factory :sheet, :class => Sheet do |sheet|
+    sheet.caption "sheet"
+    sheet.width 222
+    sheet.height 111
+    sheet.visible 1
+    sheet.author_id 1
+  end
+
+  factory :sheet_panel, :class => SheetPanel do |sheet_panel|
+    sheet_panel.sheet_id 1
+    sheet_panel.panel_id 1
+    sheet_panel.x 111
+    sheet_panel.y 200
+    sheet_panel.z 1
+    sheet_panel.t 0
+    sheet_panel.author_id 1
   end
 
   factory :original_picture, :class => OriginalPicture do |op|
@@ -93,6 +129,9 @@ FactoryGirl.define do
     op.height 111
     op.filesize 100000
     op.artist_id 1
+    op.md5 'op8f6bcd4621d373cade4e832627b4f6'
+    op.published_at nil
+    op.stopped_at nil
   end
 
   factory :oplg, :class => OriginalPictureLicenseGroup do |oplg|
@@ -105,6 +144,7 @@ FactoryGirl.define do
     rp.width 222
     rp.height 111
     rp.filesize 100000
+    rp.md5 'rp8f6bcd4621d373cade4e832627b4f6'
     rp.artist_id 1
     rp.license_id 1
     rp.classname 'StandardLicense'
@@ -113,11 +153,12 @@ FactoryGirl.define do
 
   factory :picture, :class => Picture do |p|
     p.original_picture_id 1
-    p.revision 1
+    p.revision 0
     p.ext 'png'
     p.width 222
     p.height 111
     p.filesize 100000
+    p.md5 'ap8f6bcd4621d373cade4e832627b4f6'
     p.artist_id 1
     p.license_id 1
     p.artist_name 'no name'
@@ -139,6 +180,7 @@ FactoryGirl.define do
     sbt.classname 'Plain'
     sbt.caption 'normal fuki'
     sbt.t 0
+    sbt.system_picture_id 1 
     sbt.settings '{}'
   end
 
@@ -149,6 +191,7 @@ FactoryGirl.define do
     sb.z 1
     sb.t 0
     sb.settings '{}'
+    sb.caption 'test pict'
   end
 
   factory :balloon, :class => Balloon do |balloon|
@@ -158,13 +201,16 @@ FactoryGirl.define do
     balloon.y 200
     balloon.width 222 
     balloon.height 333 
-    balloon.caption 'test pict'
     balloon.settings nil
   end
 
   factory :speech, :class => Speech do |speech|
     speech.speech_balloon_id 1
+    speech.writing_format_id 1
     speech.content 'test'
+    speech.font_size 1.0
+    speech.text_align 1
+    speech.fore_color 0xffffff
     speech.x 10
     speech.y 100
     speech.width 200
@@ -184,21 +230,80 @@ FactoryGirl.define do
     pp.height 300
   end
 
+  factory :ground_color, :class => GroundColor do |gc|
+    gc.panel_id 1
+    gc.code 1
+    gc.orientation 0
+    gc.z 1
+  end
+
+  factory :ground_picture, :class => GroundPicture do |gp|
+    gp.panel_id 1
+    gp.picture_id 1
+    gp.z 1
+  end
+
   factory :panel, :class => Panel do |panel|
     panel.border 1
-    panel.x nil
-    panel.y nil
-    panel.z nil
     panel.width 100
     panel.height 300
+    panel.caption 'panel caption'
     panel.publish 1
     panel.author_id 1
   end
 
-  factory :story, :class => Story do |story|
-    story.comic_id 1
-    story.panel_id 1
-    story.author_id 1
-    story.t 0
+  factory :provider, :class => Provider do |provider|
+    provider.name 'admin@penguinkingdom.com'
+    provider.caption 'ペンギン王国'
+    provider.url 'http://localhost:3000/'
+    provider.description 'ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。'
+    provider.demander_url 'http://localhost:3000/demanders'
+    provider.provider_status_id 1
+  end
+
+  factory :provider_status, :class => ProviderStatus do |provider_status|
+    provider_status.token nil
+    provider_status.receive_hour1 nil
+    provider_status.receive_hour2 nil
+    provider_status.received_at nil
+    provider_status.stopped_at nil
+  end
+
+  factory :demander, :class => Demander do |demander|
+    demander.demand_user_id 1
+    demander.name 'admin@penguinkingdom.com'
+    demander.caption 'ペンギン王国'
+    demander.url 'http://localhost:3000/'
+    demander.description 'ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。'
+    demander.demander_url 'http://localhost:3000/demanders'
+    demander.demander_status_id 1
   end
+
+  factory :demander_status, :class => DemanderStatus do |demander_status|
+    demander_status.requested_at nil
+    demander_status.rejected_at nil
+    demander_status.approved_at nil
+    demander_status.token nil
+    demander_status.receive_hour1 nil
+    demander_status.receive_hour2 nil
+  end
+
+  factory :provider_license, :class => ProviderLicense do |provider_license|
+    provider_license.provider_id nil
+    provider_license.providers_license_id nil
+    provider_license.demanders_license_id nil
+  end
+
+  factory :provider_artist, :class => ProviderArtist do |provider_artist|
+    provider_artist.provider_id nil
+    provider_artist.providers_artist_id nil
+    provider_artist.demanders_artist_id nil
+  end
+
+  factory :provider_original_picture, :class => ProviderOriginalPicture do |provider_original_picture|
+    provider_original_picture.provider_id nil
+    provider_original_picture.providers_original_picture_id nil
+    provider_original_picture.demanders_original_picture_id nil
+  end
+
 end