OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / spec / factories.rb
1 # -*- encoding: utf-8 -*-
2 #テストデータ
3 FactoryGirl.define do
4   factory :admin, :class => Admin do |admin|
5     admin.sequence(:email) { |n| "admin#{n}@gmail.com"}
6     admin.password "admin0100"
7     admin.password_confirmation "admin0100"
8     admin.approve 1
9   end
10
11   factory :user_yas, :class => User do |user|
12     user.sequence(:email) { |n| "hoge#{n}@gmail.com"}
13     user.password "user0100"
14     user.password_confirmation "user0100"
15   #  user.author FactoryGirl.create(:author_yas)
16   end
17
18   factory :demand_user, :class => DemandUser do |demand_user|
19     demand_user.sequence(:email) { |n| "hoge#{n}@gmail.com"}
20     demand_user.password "user0100"
21     demand_user.password_confirmation "user0100"
22   #  user.author FactoryGirl.create(:author_yas)
23   end
24
25   factory :author, :class => Author do |author|
26     author.name 'test'
27     author.sequence(:user_id) { |n| n}
28   end
29
30   factory :author_yas, :class => Author do |author|
31     author.name 'yassan'
32     author.sequence(:user_id) { |n| n}
33   #  author.association :user_yas
34   #  author.artist FactoryGirl.create(:artist_yas)
35   end
36
37   factory :artist, :class => Artist do |artist|
38     artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
39     artist.name 'art'
40   #  artist.association :author_yas
41   end
42
43   factory :artist_yas, :class => Artist do |artist|
44     artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
45     artist.name 'yas'
46   #  artist.association :author_yas
47   end
48
49   factory :license_group, :class => LicenseGroup do |license_group|
50     license_group.name 'pettan_public_01'
51     license_group.classname 'PettanPublicLicense'
52     license_group.caption 'pettan public 0.1'
53     license_group.url 'http://test.lc/'
54   end
55
56   factory :license, :class => License do |license|
57     license.license_group_id 1
58     license.name 'peta2.5'
59     license.caption 'flag'
60     license.url 'http://test.lc/'
61     license.system_picture_id 1
62   end
63
64   factory :writing_format, :class => WritingFormat do |writing_format|
65     writing_format.name 'simple_format@pettan.com'
66     writing_format.classname 'SimpleFormat'
67     writing_format.caption 'sl'
68     writing_format.system_picture_id 1 
69     writing_format.settings '{}'
70   end
71
72   factory :comic, :class => Comic do |comic|
73     comic.title "comic"
74     comic.description 'comic description'
75     comic.visible 1
76   end
77
78   factory :original_picture, :class => OriginalPicture do |op|
79     op.ext 'png'
80     op.width 222
81     op.height 111
82     op.filesize 100000
83     op.artist_id 1
84     op.md5 'op8f6bcd4621d373cade4e832627b4f6'
85     op.published_at nil
86     op.stopped_at nil
87   end
88
89   factory :oplg, :class => OriginalPictureLicenseGroup do |oplg|
90     oplg.original_picture_id 1
91     oplg.license_group_id 1
92   end
93
94   factory :resource_picture, :class => ResourcePicture do |rp|
95     rp.ext 'png'
96     rp.width 222
97     rp.height 111
98     rp.filesize 100000
99     rp.md5 'rp8f6bcd4621d373cade4e832627b4f6'
100     rp.artist_id 1
101     rp.license_id 1
102     rp.classname 'StandardLicense'
103     rp.original_picture_id 1
104   end
105
106   factory :picture, :class => Picture do |p|
107     p.original_picture_id 1
108     p.revision 0
109     p.ext 'png'
110     p.width 222
111     p.height 111
112     p.filesize 100000
113     p.md5 'ap8f6bcd4621d373cade4e832627b4f6'
114     p.artist_id 1
115     p.license_id 1
116     p.artist_name 'no name'
117     p.classname 'StandardLicense'
118     p.credit ''
119     p.settings ''
120   end
121
122   factory :system_picture, :class => SystemPicture do |sp|
123     sp.ext 'png'
124     sp.width 222
125     sp.height 111
126     sp.filesize 100000
127     sp.md5 '098f6bcd4621d373cade4e832627b4f6'
128   end
129
130   factory :speech_balloon_template, :class => SpeechBalloonTemplate do |sbt|
131     sbt.name 'Plain@pettanr.com'
132     sbt.classname 'Plain'
133     sbt.caption 'normal fuki'
134     sbt.t 0
135     sbt.system_picture_id 1 
136     sbt.settings '{}'
137   end
138
139   factory :speech_balloon, :class => SpeechBalloon do |sb|
140     sb.panel_id 1
141     sb.speech_balloon_template_id 1
142     sb.classname 'Plain'
143     sb.z 1
144     sb.t 0
145     sb.settings '{}'
146     sb.caption 'test pict'
147   end
148
149   factory :balloon, :class => Balloon do |balloon|
150     balloon.speech_balloon_id 1
151     balloon.system_picture_id 1 
152     balloon.x 100
153     balloon.y 200
154     balloon.width 222 
155     balloon.height 333 
156     balloon.settings nil
157   end
158
159   factory :speech, :class => Speech do |speech|
160     speech.speech_balloon_id 1
161     speech.writing_format_id 1
162     speech.content 'test'
163     speech.font_size 1.0
164     speech.text_align 1
165     speech.fore_color 0xffffff
166     speech.x 10
167     speech.y 100
168     speech.width 200
169     speech.height 190
170     speech.settings nil
171   end
172
173   factory :panel_picture, :class => PanelPicture do |pp|
174     pp.panel_id 1
175     pp.picture_id 1
176     pp.link ''
177     pp.x 111
178     pp.y 200
179     pp.z 1
180     pp.t 0
181     pp.width 100
182     pp.height 300
183   end
184
185   factory :ground_color, :class => GroundColor do |gc|
186     gc.panel_id 1
187     gc.code 1
188     gc.z 1
189   end
190
191   factory :ground_picture, :class => GroundPicture do |gp|
192     gp.panel_id 1
193     gp.picture_id 1
194     gp.z 1
195   end
196
197   factory :panel, :class => Panel do |panel|
198     panel.border 1
199     panel.width 100
200     panel.height 300
201     panel.caption 'panel caption'
202     panel.publish 1
203     panel.author_id 1
204   end
205
206   factory :story, :class => Story do |story|
207     story.comic_id 1
208     story.panel_id 1
209     story.author_id 1
210     story.t 0
211     story.x nil
212     story.y nil
213     story.z nil
214   end
215
216   factory :provider, :class => Provider do |provider|
217     provider.name 'admin@penguinkingdom.com'
218     provider.caption 'ペンギン王国'
219     provider.url 'http://localhost:3000/'
220     provider.description 'ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。'
221     provider.demander_url 'http://localhost:3000/demanders'
222     provider.provider_status_id 1
223   end
224
225   factory :provider_status, :class => ProviderStatus do |provider_status|
226     provider_status.token nil
227     provider_status.receive_hour1 nil
228     provider_status.receive_hour2 nil
229     provider_status.received_at nil
230     provider_status.stopped_at nil
231   end
232
233   factory :demander, :class => Demander do |demander|
234     demander.demand_user_id 1
235     demander.name 'admin@penguinkingdom.com'
236     demander.caption 'ペンギン王国'
237     demander.url 'http://localhost:3000/'
238     demander.description 'ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。'
239     demander.demander_url 'http://localhost:3000/demanders'
240     demander.demander_status_id 1
241   end
242
243   factory :demander_status, :class => DemanderStatus do |demander_status|
244     demander_status.requested_at nil
245     demander_status.rejected_at nil
246     demander_status.approved_at nil
247     demander_status.token nil
248     demander_status.receive_hour1 nil
249     demander_status.receive_hour2 nil
250   end
251
252   factory :provider_license, :class => ProviderLicense do |provider_license|
253     provider_license.provider_id nil
254     provider_license.providers_license_id nil
255     provider_license.demanders_license_id nil
256   end
257
258   factory :provider_artist, :class => ProviderArtist do |provider_artist|
259     provider_artist.provider_id nil
260     provider_artist.providers_artist_id nil
261     provider_artist.demanders_artist_id nil
262   end
263
264   factory :provider_original_picture, :class => ProviderOriginalPicture do |provider_original_picture|
265     provider_original_picture.provider_id nil
266     provider_original_picture.providers_original_picture_id nil
267     provider_original_picture.demanders_original_picture_id nil
268   end
269
270 end