OSDN Git Service

pass model import test
[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.name 'peta2.5'
48   license.url 'http://test.lc/'
49   license.cc_by 0
50   license.cc_sa 0
51   license.cc_nd 0
52   license.cc_nc 0
53   license.no_resize 0
54   license.no_flip 0
55   license.no_convert 0
56   license.keep_aspect_ratio 0
57 end
58
59 Factory.define :common_license, :class => CommonLicense do |license|
60   license.license_id 0
61   license.name 'peta2.1'
62   license.url 'http://test.lc/'
63   license.cc_by 0
64   license.cc_sa 0
65   license.cc_nd 0
66   license.cc_nc 0
67   license.no_resize 0
68   license.no_flip 0
69   license.no_convert 0
70   license.keep_aspect_ratio 0
71 end
72
73 Factory.define :original_license, :class => OriginalLicense do |license|
74   license.license_id 0
75   license.name 'peta2.1'
76   license.url 'http://test.olc/'
77   license.cc_by 0
78   license.cc_sa 0
79   license.cc_nd 0
80   license.cc_nc 0
81   license.no_resize 0
82   license.no_flip 0
83   license.no_convert 0
84   license.keep_aspect_ratio 0
85 end
86
87 Factory.define :comic, :class => Comic do |comic|
88   comic.title "comic"
89   comic.width 100
90   comic.height 10
91   comic.visible 3
92   comic.editable 3
93 end
94
95 Factory.define :normal_comic, :class => Comic do |comic|
96   comic.title "normal_comic"
97   comic.width 100
98   comic.height 10
99   comic.visible 3
100   comic.editable 0
101 end
102
103 Factory.define :visible_comic, :class => Comic do |comic|
104   comic.title "visible_comic"
105   comic.width 100
106   comic.height 10
107   comic.visible 3
108   comic.editable 0
109 end
110
111 Factory.define :editable_comic, :class => Comic do |comic|
112   comic.title "editable_comic"
113   comic.width 100
114   comic.height 10
115   comic.visible 3
116   comic.editable 3
117 end
118
119 Factory.define :hidden_comic, :class => Comic do |comic|
120   comic.title "hidden_comic"
121   comic.width 100
122   comic.height 10
123   comic.visible 0
124   comic.editable 0
125 end
126
127 Factory.define :original_picture, :class => OriginalPicture do |op|
128   op.ext 'png'
129   op.width 222
130   op.height 111
131   op.filesize 100000
132   op.artist_id 1
133   op.license_id 1
134 end
135
136 Factory.define :resource_picture, :class => ResourcePicture do |rp|
137   rp.ext 'png'
138   rp.width 222
139   rp.height 111
140   rp.filesize 100000
141   rp.artist_id 1
142   rp.license_id 1
143   rp.original_picture_id 1
144 end
145
146 Factory.define :system_picture, :class => SystemPicture do |sp|
147   sp.ext 'png'
148   sp.width 222
149   sp.height 111
150   sp.filesize 100000
151   sp.md5 '098f6bcd4621d373cade4e832627b4f6'
152 end
153
154 Factory.define :speech_balloon_template, :class => SpeechBalloonTemplate do |sbt|
155   sbt.name 'Plain@pettanr.com'
156   sbt.classname 'Plain'
157   sbt.caption 'normal fuki'
158   sbt.t 0
159   sbt.settings '{}'
160 end
161
162 Factory.define :speech_balloon, :class => SpeechBalloon do |sb|
163   sb.panel_id 1
164   sb.speech_balloon_template_id 1
165   sb.classname 'Plain'
166   sb.z 1
167   sb.t 0
168   sb.settings '{}'
169 end
170
171 Factory.define :balloon, :class => Balloon do |balloon|
172   balloon.speech_balloon_id 1
173   balloon.system_picture_id 1 
174   balloon.x 100
175   balloon.y 200
176   balloon.width 222 
177   balloon.height 333 
178   balloon.caption 'test pict'
179   balloon.settings nil
180 end
181
182 Factory.define :speech, :class => Speech do |speech|
183   speech.speech_balloon_id 1
184   speech.content 'test'
185   speech.x 10
186   speech.y 100
187   speech.width 200
188   speech.height 190
189   speech.settings nil
190 end
191
192 Factory.define :panel_picture, :class => PanelPicture do |pp|
193   pp.panel_id 1
194   pp.resource_picture_id 1
195   pp.link ''
196   pp.x 111
197   pp.y 200
198   pp.z 1
199   pp.t 0
200   pp.width 100
201   pp.height 300
202 end
203
204 Factory.define :panel, :class => Panel do |panel|
205   panel.comic_id 1
206   panel.border 1
207   panel.x nil
208   panel.y nil
209   panel.z nil
210   panel.t 0
211   panel.width 100
212   panel.height 300
213   panel.author_id 1
214 end
215