OSDN Git Service

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