Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 120 lines (98 sloc) 2.16 kB
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
1 FactoryGirl.define do
84d4e7b @qrush Make the test suite work again.
qrush authored
2 sequence :email do |n|
3 "user#{n}@example.com"
4 end
5
6 sequence :handle do |n|
7 "handle#{n}"
8 end
9
10 factory :user do
11 email
12 handle
13 password "password"
77f188f @qrush Push essential owner tests into integration, user factory cleanup
qrush authored
14 api_key "secret123"
84d4e7b @qrush Make the test suite work again.
qrush authored
15 end
16
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
17 factory :dependency do
18 gem_dependency { Gem::Dependency.new(Rubygem.last.name, "1.0.0") }
081399f @nickrivadeneira use factory_girl 2.0 DSL for parent factories
nickrivadeneira authored
19 rubygem
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
20 version
21
081399f @nickrivadeneira use factory_girl 2.0 DSL for parent factories
nickrivadeneira authored
22 factory :development_dependency do
23 gem_dependency { Gem::Dependency.new(Rubygem.last.name, "1.0.0", :development) }
24 end
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
25
d5f23ad @nickrivadeneira apparently I am inept at factory girl
nickrivadeneira authored
26 factory :runtime_dependency do
081399f @nickrivadeneira use factory_girl 2.0 DSL for parent factories
nickrivadeneira authored
27 end
7b8300e @evanphx Add ability for a dependency to reference an untracked gem
evanphx authored
28
29 factory :unresolved_dependency do
30 gem_dependency { Gem::Dependency.new("unresolved-gem-nothere", "1.0.0") }
31 end
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
32 end
33
34 factory :linkset do
35 home 'http://example.com'
36 wiki 'http://example.com'
37 docs 'http://example.com'
38 mail 'http://example.com'
39 code 'http://example.com'
40 bugs 'http://example.com'
41 end
42
43 factory :ownership do
44 rubygem
45 user
46 end
47
48 factory :subscription do
49 rubygem
50 user
51 end
52
53 sequence :name do |n|
54 "RubyGem#{n}"
55 end
56
57 factory :rubygem do
ef758b6 @qrush Major cleanup of leftover judo factories into FG transient properties
qrush authored
58 transient do
59 owners []
60 number nil
61 end
62
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
63 linkset
64 name
65
ef758b6 @qrush Major cleanup of leftover judo factories into FG transient properties
qrush authored
66 after(:create) do |rubygem, evaluator|
67 evaluator.owners.each do |owner|
68 create(:ownership, rubygem: rubygem, user: owner)
69 end
70
71 if evaluator.number
72 create(:version, rubygem: rubygem, number: evaluator.number)
081399f @nickrivadeneira use factory_girl 2.0 DSL for parent factories
nickrivadeneira authored
73 end
20d96b0 @qrush Split out gem helpers, simple test for dashboard
qrush authored
74
ef758b6 @qrush Major cleanup of leftover judo factories into FG transient properties
qrush authored
75 if evaluator.downloads
0e1a956 @spk Use Redis.current instead of global variable $redis
spk authored
76 Redis.current[Download.key(rubygem)] = evaluator.downloads
20d96b0 @qrush Split out gem helpers, simple test for dashboard
qrush authored
77 end
78 end
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
79 end
80
81 sequence :number do |n|
82 "0.0.#{n}"
83 end
84
85 factory :version do
86 authors ["Joe User"]
87 built_at 1.day.ago
88 description "Some awesome gem"
89 indexed true
a72bc3b @arthurnn Revert "Revert "Merge branch 'jimmycuadra-metadata'""
arthurnn authored
90 metadata "foo" => "bar"
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
91 number
92 platform "ruby"
b3db42b @melissavoegeli add ruby version unit tests
melissavoegeli authored
93 ruby_version ">= 2.0.0"
b63d2d4 Display licenses for gem versions.
Ian Lesperance & Matt Parker authored
94 licenses "MIT"
3d2c2fb @seeingidog Display external requirements for gem versions
seeingidog authored
95 requirements "Opencv"
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
96 rubygem
5b24e35 @gnarg brought Chris's patch up to date and added a script to calculate size…
gnarg authored
97 size 1024
5243ca3 @arthurnn Revert "Revert "Merge pull request #872 from kbrock/include-shas""
arthurnn authored
98 sha256 "tdQEXD9Gb6kf4sxqvnkjKhpXzfEE96JucW4KHieJ33g="
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
99 end
100
3e626c2 @evanphx Add ability to pull version history out of SQL
evanphx authored
101 factory :version_history do
102 day { Time.zone.today.to_s }
103 count 1
104 end
105
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
106 sequence :url do |n|
107 "http://example#{n}.com"
108 end
109
110 factory :web_hook do
111 rubygem
112 url
113 user
114
081399f @nickrivadeneira use factory_girl 2.0 DSL for parent factories
nickrivadeneira authored
115 factory :global_web_hook do
116 rubygem nil
117 end
0423753 @nickrivadeneira consolidate application factories into one file
nickrivadeneira authored
118 end
119 end
Something went wrong with that request. Please try again.