X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=spec%2Ffactories.rb;h=00c9ee8a23f16e93d4f3051be6b42ea7dccb922a;hb=cff561f0f6edceed0daac9f0ba062f75e3d6a814;hp=c84bf258fa559bee67b26727d395992503938c49;hpb=a10e5f35742b9a2b5d5b1387b898f850a60d24ff;p=pettanr%2Fpettanr.git diff --git a/spec/factories.rb b/spec/factories.rb index c84bf258..00c9ee8a 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -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,6 +15,13 @@ 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.sequence(:user_id) { |n| n} @@ -52,39 +61,15 @@ 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 :color, :class => Color do |color| + color.name 'black' + color.code 0 + color.t 0 end factory :comic, :class => Comic do |comic| comic.title "comic" - comic.width 100 - comic.height 10 - comic.visible 3 + comic.visible 1 end factory :original_picture, :class => OriginalPicture do |op| @@ -93,6 +78,7 @@ FactoryGirl.define do op.height 111 op.filesize 100000 op.artist_id 1 + op.md5 'op8f6bcd4621d373cade4e832627b4f6' end factory :oplg, :class => OriginalPictureLicenseGroup do |oplg| @@ -100,16 +86,12 @@ FactoryGirl.define do oplg.license_group_id 1 end - factory :standard_license, :class => StandardLicense do |sl| - sl.license_id 1 - sl.artist_name 'no name' - end - factory :resource_picture, :class => ResourcePicture do |rp| rp.ext 'png' rp.width 222 rp.height 111 rp.filesize 100000 + rp.md5 'rp8f6bcd4621d373cade4e832627b4f6' rp.artist_id 1 rp.license_id 1 rp.classname 'StandardLicense' @@ -123,6 +105,7 @@ FactoryGirl.define do 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' @@ -189,6 +172,24 @@ FactoryGirl.define do pp.height 300 end + factory :panel_color, :class => PanelColor do |pc| + pc.panel_id 1 + pc.z 1 + pc.code 1 + end + + factory :ground_color, :class => GroundColor do |gc| + gc.panel_id 1 + gc.color_id 1 + 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 @@ -206,4 +207,40 @@ FactoryGirl.define do story.author_id 1 story.t 0 end + + 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 end