blob: 01a69f7288ff91c3212480b70a0cb3f7e3f554bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
Factory.sequence :user do |n|
"user-#{n}"
end
Factory.define :user, :class => User do |u|
u.name { Factory.next(:user) }
u.irc_nick { Factory.next(:user) }
u.email { |u| "#{u.name}@example.com" }
end
Factory.define :agenda do |a|; end
Factory.define :agenda_item do |a|
a.sequence(:title) { |n| "Agenda Item #{n}" }
end
Factory.define :participation do |p|; end
Factory.define :vote do |v|;
v.association :voting_option
v.user { users_factory(:council) }
end
Factory.define :voting_option do |v|;
v.agenda_item { AgendaItem.create! }
v.description { "example" }
end
Factory.define :proxy do |p|;
p.council_member {users_factory(:council)}
p.proxy {users_factory(:user)}
p.agenda {Factory(:agenda)}
end
require File.expand_path("../support/users_factory.rb", __FILE__)
|