OSDN Git Service

Merge branch 'v04' of git.sourceforge.jp:/gitroot/pettanr/pettanr
[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 end
86
87 Factory.define :original_picture, :class => OriginalPicture do |op|
88   op.ext 'png'
89   op.width 222
90   op.height 111
91   op.filesize 100000
92   op.artist_id 1
93   op.license_id 1
94 end
95
96 Factory.define :resource_picture, :class => ResourcePicture do |rp|
97   rp.ext 'png'
98   rp.width 222
99   rp.height 111
100   rp.filesize 100000
101   rp.artist_id 1
102   rp.license_id 1
103   rp.original_picture_id 1
104 end
105
106 Factory.define :system_picture, :class => SystemPicture do |sp|
107   sp.ext 'png'
108   sp.width 222
109   sp.height 111
110   sp.filesize 100000
111   sp.md5 '098f6bcd4621d373cade4e832627b4f6'
112 end
113
114 Factory.define :speech_balloon_template, :class => SpeechBalloonTemplate do |sbt|
115   sbt.name 'Plain@pettanr.com'
116   sbt.classname 'Plain'
117   sbt.caption 'normal fuki'
118   sbt.t 0
119   sbt.settings '{}'
120 end
121
122 Factory.define :speech_balloon, :class => SpeechBalloon do |sb|
123   sb.panel_id 1
124   sb.speech_balloon_template_id 1
125   sb.classname 'Plain'
126   sb.z 1
127   sb.t 0
128   sb.settings '{}'
129 end
130
131 Factory.define :balloon, :class => Balloon do |balloon|
132   balloon.speech_balloon_id 1
133   balloon.system_picture_id 1 
134   balloon.x 100
135   balloon.y 200
136   balloon.width 222 
137   balloon.height 333 
138   balloon.caption 'test pict'
139   balloon.settings nil
140 end
141
142 Factory.define :speech, :class => Speech do |speech|
143   speech.speech_balloon_id 1
144   speech.content 'test'
145   speech.x 10
146   speech.y 100
147   speech.width 200
148   speech.height 190
149   speech.settings nil
150 end
151
152 Factory.define :panel_picture, :class => PanelPicture do |pp|
153   pp.panel_id 1
154   pp.resource_picture_id 1
155   pp.link ''
156   pp.x 111
157   pp.y 200
158   pp.z 1
159   pp.t 0
160   pp.width 100
161   pp.height 300
162 end
163
164 Factory.define :panel, :class => Panel do |panel|
165   panel.border 1
166   panel.x nil
167   panel.y nil
168   panel.z nil
169   panel.width 100
170   panel.height 300
171   panel.publish 1
172   panel.author_id 1
173 end
174
175 Factory.define :story, :class => Story do |story|
176   story.comic_id 1
177   story.panel_id 1
178   story.author_id 1
179   story.t 0
180 end