OSDN Git Service

7617410870ade8b3842bd1392c72e8c7aa56d7ff
[pettanr/pettanr.git] / spec / factories.rb
1 Factory.define :admin, :class => Admin do |admin|
2   admin.sequence(:email) { |n| "admin#{n}@gmail.com"}
3   admin.password "admin0100"
4   admin.password_confirmation "admin0100"
5   admin.approve 1
6 end
7
8 Factory.define :user_yas, :class => User do |user|
9   user.sequence(:email) { |n| "hoge#{n}@gmail.com"}
10   user.password "user0100"
11   user.password_confirmation "user0100"
12 #  user.author Factory(:author_yas)
13 end
14
15 Factory.define :author, :class => Author do |author|
16   author.name nil
17   author.sequence(:user_id) { |n| n}
18 end
19
20 Factory.define :author_yas, :class => Author do |author|
21   author.name 'yassan'
22   author.sequence(:user_id) { |n| n}
23 #  author.association :user_yas
24 #  author.artist Factory(:artist_yas)
25 end
26
27 Factory.define :artist, :class => Artist do |artist|
28   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
29   artist.name 'art'
30 #  artist.association :author_yas
31 end
32
33 Factory.define :artist_yas, :class => Artist do |artist|
34   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
35   artist.name 'yas'
36 #  artist.association :author_yas
37 end
38
39 Factory.define :license_group, :class => LicenseGroup do |license_group|
40   license_group.name 'pettan_public_01'
41   license_group.classname 'PettanPublicLicense'
42   license_group.caption 'pettan public 0.1'
43   license_group.url 'http://test.lc/'
44 end
45
46 Factory.define :license, :class => License do |license|
47   license.license_group_id 1
48   license.name 'peta2.5'
49   license.caption 'flag'
50   license.url 'http://test.lc/'
51   license.system_picture_id 1
52 end
53
54 Factory.define :common_license, :class => CommonLicense do |license|
55   license.license_id 0
56   license.name 'peta2.1'
57   license.url 'http://test.lc/'
58   license.cc_by 0
59   license.cc_sa 0
60   license.cc_nd 0
61   license.cc_nc 0
62   license.no_resize 0
63   license.no_flip 0
64   license.no_convert 0
65   license.keep_aspect_ratio 0
66 end
67
68 Factory.define :original_license, :class => OriginalLicense do |license|
69   license.license_id 0
70   license.name 'peta2.1'
71   license.url 'http://test.olc/'
72   license.cc_by 0
73   license.cc_sa 0
74   license.cc_nd 0
75   license.cc_nc 0
76   license.no_resize 0
77   license.no_flip 0
78   license.no_convert 0
79   license.keep_aspect_ratio 0
80 end
81
82 Factory.define :comic, :class => Comic do |comic|
83   comic.title "comic"
84   comic.width 100
85   comic.height 10
86   comic.visible 3
87   comic.editable 3
88 end
89
90 Factory.define :normal_comic, :class => Comic do |comic|
91   comic.title "normal_comic"
92   comic.width 100
93   comic.height 10
94   comic.visible 3
95   comic.editable 0
96 end
97
98 Factory.define :visible_comic, :class => Comic do |comic|
99   comic.title "visible_comic"
100   comic.width 100
101   comic.height 10
102   comic.visible 3
103   comic.editable 0
104 end
105
106 Factory.define :editable_comic, :class => Comic do |comic|
107   comic.title "editable_comic"
108   comic.width 100
109   comic.height 10
110   comic.visible 3
111   comic.editable 3
112 end
113
114 Factory.define :hidden_comic, :class => Comic do |comic|
115   comic.title "hidden_comic"
116   comic.width 100
117   comic.height 10
118   comic.visible 0
119   comic.editable 0
120 end
121
122 Factory.define :original_picture, :class => OriginalPicture do |op|
123   op.ext 'png'
124   op.width 222
125   op.height 111
126   op.filesize 100000
127   op.artist_id 1
128 end
129
130 Factory.define :oplg, :class => OriginalPictureLicenseGroup do |oplg|
131   oplg.original_picture_id 1
132   oplg.license_group_id 1
133 end
134
135 Factory.define :standard_license, :class => StandardLicense do |sl|
136   sl.license_id 1
137   sl.artist_name 'no name'
138 end
139
140 Factory.define :resource_picture, :class => ResourcePicture do |rp|
141   rp.ext 'png'
142   rp.width 222
143   rp.height 111
144   rp.filesize 100000
145   rp.artist_id 1
146   rp.license_id 1
147   rp.classname 'StandardLicense'
148   rp.original_picture_id 1
149 end
150
151 Factory.define :picture, :class => Picture do |p|
152   p.original_picture_id 1
153   p.revision 1
154   p.ext 'png'
155   p.width 222
156   p.height 111
157   p.filesize 100000
158   p.artist_id 1
159   p.license_id 1
160   p.artist_name 'no name'
161   p.classname 'StandardLicense'
162   p.credit ''
163   p.settings ''
164 end
165
166 Factory.define :system_picture, :class => SystemPicture do |sp|
167   sp.ext 'png'
168   sp.width 222
169   sp.height 111
170   sp.filesize 100000
171   sp.md5 '098f6bcd4621d373cade4e832627b4f6'
172 end
173
174 Factory.define :speech_balloon_template, :class => SpeechBalloonTemplate do |sbt|
175   sbt.name 'Plain@pettanr.com'
176   sbt.classname 'Plain'
177   sbt.caption 'normal fuki'
178   sbt.t 0
179   sbt.settings '{}'
180 end
181
182 Factory.define :speech_balloon, :class => SpeechBalloon do |sb|
183   sb.panel_id 1
184   sb.speech_balloon_template_id 1
185   sb.classname 'Plain'
186   sb.z 1
187   sb.t 0
188   sb.settings '{}'
189 end
190
191 Factory.define :balloon, :class => Balloon do |balloon|
192   balloon.speech_balloon_id 1
193   balloon.system_picture_id 1 
194   balloon.x 100
195   balloon.y 200
196   balloon.width 222 
197   balloon.height 333 
198   balloon.caption 'test pict'
199   balloon.settings nil
200 end
201
202 Factory.define :speech, :class => Speech do |speech|
203   speech.speech_balloon_id 1
204   speech.content 'test'
205   speech.x 10
206   speech.y 100
207   speech.width 200
208   speech.height 190
209   speech.settings nil
210 end
211
212 Factory.define :panel_picture, :class => PanelPicture do |pp|
213   pp.panel_id 1
214   pp.resource_picture_id 1
215   pp.link ''
216   pp.x 111
217   pp.y 200
218   pp.z 1
219   pp.t 0
220   pp.width 100
221   pp.height 300
222 end
223
224 Factory.define :panel, :class => Panel do |panel|
225   panel.comic_id 1
226   panel.border 1
227   panel.x nil
228   panel.y nil
229   panel.z nil
230   panel.t 0
231   panel.width 100
232   panel.height 300
233   panel.author_id 1
234 end
235