master
1FactoryGirl.define do
2 factory :activity, class: Activity do
3 user { create(:user) }
4 subject { create(:favorite) }
5 end
6
7 factory :category, class: Category do
8 name { FFaker::Name.name }
9 slug { FFaker::Name.name.parameterize }
10 end
11
12 factory :cake, class: Creation, aliases: [:creation] do
13 name { FFaker::Name.name }
14 story { FFaker::HipsterIpsum.words(50).join(' ') }
15 association :user
16 association :category
17 factory :published_cake do
18 photos_count 1
19 after(:create) do |cake, evaluator|
20 cake.photos << create(:photo, image: 'spec/fixtures/images/example.png')
21 end
22 end
23 end
24
25 factory :user_session, class: UserSession do
26 association :user
27 key SecureRandom.urlsafe_base64(32)
28 ip FFaker::Internet.ip_v4_address
29 factory :active_session do
30 accessed_at Time.now
31 end
32 end
33
34 factory :favorite do
35 association :user
36 association :creation
37 end
38
39 factory :photo, class: Photo do
40 image { 'spec/fixtures/images/example.png' }
41 content_type { "" }
42 original_filename { "" }
43 latitude { "" }
44 longitude { "" }
45 sha256 { "" }
46 watermark { "" }
47 end
48
49 factory :tag, :class => "ActsAsTaggableOn::Tag" do
50 name { FFaker::Name.name }
51 end
52
53 factory :tutorial do
54 heading { FFaker::Name.name }
55 description "well hello there"
56 url { FFaker::Internet.http_url }
57 image_url { FFaker::Internet.http_url }
58 author { FFaker::Name.name }
59 author_url { FFaker::Internet.http_url }
60 association :user
61 end
62
63 factory :user, class: User do
64 name { FFaker::Name.name }
65 email { FFaker::Internet.email }
66 password 'password'
67 website { FFaker::Internet.http_url }
68 city 'calgary'
69 factory :admin do
70 admin true
71 end
72 end
73
74 factory :location do
75 latitude "107"
76 longitude "99"
77 city "Calgary"
78 country "Canada"
79 end
80
81 factory :tool do
82 name { FFaker::Name.name }
83 asin { SecureRandom.uuid }
84 end
85end