Permalink
Browse files

use factory_girl 2.0 DSL for parent factories

  • Loading branch information...
1 parent ab36361 commit 4f5b6ded425712fa69e4017b482c866283b43428 @nickrivadeneira nickrivadeneira committed Sep 14, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 test/factories/application.rb
@@ -1,15 +1,15 @@
FactoryGirl.define do
factory :dependency do
gem_dependency { Gem::Dependency.new(Rubygem.last.name, "1.0.0") }
- rubygem # { Factory(:rubygem) }
+ rubygem
version
- end
- factory :development_dependency, :parent => :dependency do
- gem_dependency { Gem::Dependency.new(Rubygem.last.name, "1.0.0", :development) }
- end
+ factory :development_dependency do
+ gem_dependency { Gem::Dependency.new(Rubygem.last.name, "1.0.0", :development) }
+ end
- factory :runtime_dependency, :parent => :dependency do
+ factory :runtime_dependency, :parent => :dependency do
+ end
end
factory :linkset do
@@ -44,11 +44,11 @@
factory :rubygem do
linkset
name
- end
- factory :rubygem_with_downloads, :parent => :rubygem do
- after_create do |r|
- $redis[Download.key(r)] = r['downloads']
+ factory :rubygem_with_downloads do
+ after_create do |r|
+ $redis[Download.key(r)] = r['downloads']
+ end
end
end
@@ -74,9 +74,9 @@
rubygem
url
user
- end
- factory :global_web_hook, :parent => :web_hook do
- rubygem nil
+ factory :global_web_hook do
+ rubygem nil
+ end
end
end

0 comments on commit 4f5b6de

Please sign in to comment.