lib/bently/recipe/factory-girl-rails.rb in bently-0.1.0 vs lib/bently/recipe/factory-girl-rails.rb in bently-1.0.0

- old
+ new

@@ -1,35 +1,38 @@ module Bently - class FactoryGirlRails < RailsRecipe - step :add_gem, 'gem "factory_girl_rails", "~> 4.0", :group => :test' - step :shell, 'bundle install' - step :sample_factory_file + name 'factory_girl_rails' + category 'gem' + description 'downloads and installs factory_girl_rails gem' + homepage 'https://github.com/thoughtbot/factory_girl_rails/blob/master/README.md' - protected - - def sample_factory_file - touch :file => './spec/factories.rb', :with => factory_file + def initialize + gem_group :test do + gem "factory_girl_rails", "~> 4.0" + end + bundle + create './spec/factories.rb', factory_file end + protected + def factory_file -%{# # This will guess the User class -# FactoryGirl.define do -# factory :user do -# first_name "John" -# last_name "Doe" -# admin false -# end -# -# # This will use the User class (Admin would have been guessed) -# factory :admin, class: User do -# first_name "Admin" -# last_name "User" -# admin true -# end -# end} + %{# # This will guess the User class + # FactoryGirl.define do + # factory :user do + # first_name "John" + # last_name "Doe" + # admin false + # end + # + # # This will use the User class (Admin would have been guessed) + # factory :admin, class: User do + # first_name "Admin" + # last_name "User" + # admin true + # end + # end} end end - end