OSDN Git Service

Merge branch 'v03_test' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v03_test
[pettanr/pettanr.git] / spec / factories.rb
1 Factory.define :admin, :class => Admin do |admin|
2   admin.email "admin@gmail.com"
3   admin.password "admin0100"
4   admin.password_confirmation "admin0100"
5 end
6
7 Factory.define :user_yas, :class => User do |user|
8   user.sequence(:email) { |n| "hoge#{n}@gmail.com"}
9   user.password "user0100"
10   user.password_confirmation "user0100"
11 #  user.author Factory(:author_yas)
12 end
13
14 Factory.define :author, :class => Author do |author|
15   author.name nil
16   author.sequence(:user_id) { |n| n}
17 end
18
19 Factory.define :author_yas, :class => Author do |author|
20   author.name 'yassan'
21   author.sequence(:user_id) { |n| n}
22 #  author.association :user_yas
23 #  author.artist Factory(:artist_yas)
24 end
25
26 Factory.define :artist, :class => Artist do |artist|
27   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
28   artist.name 'art'
29 #  artist.association :author_yas
30 end
31
32 Factory.define :artist_yas, :class => Artist do |artist|
33   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
34   artist.name 'yas'
35 #  artist.association :author_yas
36 end
37
38 Factory.define :license, :class => License do |license|
39   license.name 'peta2.5'
40   license.url 'test'
41   license.cc_by 0
42   license.cc_sa 0
43   license.cc_nd 0
44   license.cc_nc 0
45   license.no_resize 0
46   license.no_flip 0
47   license.no_convert 0
48   license.keep_aspect_ratio 0
49 end
50
51 Factory.define :normal_comic, :class => Comic do |comic|
52   comic.title "normal_comic"
53   comic.width 100
54   comic.height 10
55   comic.visible 3
56   comic.editable 0
57 end
58
59 Factory.define :visible_comic, :class => Comic do |comic|
60   comic.title "visible_comic"
61   comic.width 100
62   comic.height 10
63   comic.visible 3
64   comic.editable 0
65 end
66
67 Factory.define :editable_comic, :class => Comic do |comic|
68   comic.title "editable_comic"
69   comic.width 100
70   comic.height 10
71   comic.visible 3
72   comic.editable 3
73 end
74
75 Factory.define :hidden_comic, :class => Comic do |comic|
76   comic.title "hidden_comic"
77   comic.width 100
78   comic.height 10
79   comic.visible 0
80   comic.editable 0
81 end
82
83 Factory.define :original_picture, :class => OriginalPicture do |op|
84   op.ext 'png'
85   op.width 222
86   op.height 111
87   op.filesize 100000
88   op.artist_id 1
89   op.license_id 1
90 end
91
92 Factory.define :resource_picture, :class => ResourcePicture do |rp|
93   rp.ext 'png'
94   rp.width 222
95   rp.height 111
96   rp.filesize 100000
97   rp.artist_id 1
98   rp.license_id 1
99   rp.original_picture_id 1
100 end
101
102 Factory.define :system_picture, :class => SystemPicture do |sp|
103   sp.ext 'png'
104   sp.width 222
105   sp.height 111
106   sp.fileseze 100000
107 end
108
109 Factory.define :balloon, :class => Balloon do |balloon|
110   balloon.panel_id 1
111   balloon.balloon_template_id 1 
112   balloon.system_picture_id 1 
113   balloon.tail 1 
114   balloon.size 1 
115   balloon.x 100
116   balloon.y 200
117   balloon.z 1
118   balloon.t 0
119   balloon.width 222 
120   balloon.height 333 
121 end
122
123 Factory.define :speach, :class => Speach do |speach|
124   speach.balloon_id 1
125   speach.speach_template_id 1
126   speach.content 'test'
127   speach.x 10
128   speach.y 100
129   speach.t 0
130   speach.width 200
131   speach.height 190
132 end
133
134 Factory.define :panel_picture, :class => PanelPicture do |pp|
135   pp.panel_id 1
136   pp.resource_picture_id 1
137   pp.link ''
138   pp.x 111
139   pp.y 200
140   pp.z 1
141   pp.t 0
142   pp.width 100
143   pp.height 300
144 end
145
146 Factory.define :panel, :class => Panel do |panel|
147   panel.comic_id 1
148   panel.resource_picture_id 1
149   panel.border 1
150   panel.x 111
151   panel.y 200
152   panel.z 1
153   panel.t 0
154   panel.width 100
155   panel.height 300
156   panel.author_id 1
157 end
158