forked from hotsh/rstat.us
-
Notifications
You must be signed in to change notification settings - Fork 0
/
factories.rb
48 lines (40 loc) · 907 Bytes
/
factories.rb
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
36
37
38
39
40
41
42
43
44
45
46
47
48
Factory.define :feed do |f|
end
Factory.sequence :update_text do |i|
"This is update #{i}"
end
Factory.define :update do |u|
u.text { Factory.next(:update_text) }
u.twitter false
u.facebook false
end
Factory.sequence :usernames do |i|
"user_#{i}"
end
Factory.sequence :emails do |i|
"user_#{i}@example.com"
end
Factory.define :user do |u|
u.username { Factory.next(:usernames) }
u.author {|a| Factory(:author, :username => a.username) }
u.association :feed
end
Factory.sequence :integer do |i|
i
end
Factory.define :authorization do |a|
a.uid { Factory.next(:integer) }
a.nickname "god"
a.provider "twitter"
a.oauth_token "abcd"
a.oauth_secret "efgh"
a.association :user
end
Factory.define :author do |a|
a.association :feed
a.username "user"
a.email { Factory.next(:emails) }
a.website "http://example.com"
a.name "Something"
a.bio "Hi, I do stuff."
end