Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

factory_girl generators have been moved to factory_girl_rails gem.

  • Loading branch information...
commit 31a43023d5267e0d9db387bafffc80aff98483cc 1 parent 04804d1
@mikegehard mikegehard authored
View
9 README.rdoc
@@ -12,13 +12,7 @@ and add the following to your project's Gemfile
== Notes/Use
-Activate individual generators in your *config/application.rb* file, like so:
-
- config.generators do |g|
- g.fixture_replacement :factory_girl
- end
-
-Now a factory_girl fixture will be generated by default whenever a model is generated.
+The Factory Girl generators have moved to {the factory_girl_rails gem}[https://github.com/thoughtbot/factory_girl_rails].
The Haml generators have moved to {the haml-rails gem}[http://github.com/indirect/haml-rails].
@@ -43,7 +37,6 @@ To avoid overriding the rails built-in Erb template generators this project uses
== Contributors
* DataMapper: José Valim
-* Factory Girl: Paul Barry
* Authlogic: Jeff Tucker
* Mongomapper: Jai-Gouk Kim
* MongoMapper: Kristian Mandrup (for 0.8) - needs testing
View
25 lib/generators/factory_girl/model/model_generator.rb
@@ -1,25 +0,0 @@
-require 'generators/factory_girl'
-
-module FactoryGirl
- module Generators
- class ModelGenerator < Base
- argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
- class_option :dir, :type => :string, :default => "test/factories", :desc => "The directory where the factories should go"
-
- def create_fixture_file
- version = nil
- begin
- require 'factory_girl/version'
- version = FactoryGirl::VERSION.to_i
- rescue LoadError
- require 'factory_girl'
- version = Factory::VERSION.to_i
- rescue Object => e
- raise "Please install Factory_girl or add it to your Gemfile"
- end
-
- template "fixtures.#{version}.rb", File.join(options[:dir], "#{table_name}.rb")
- end
- end
- end
-end
View
7 lib/generators/factory_girl/model/templates/fixtures.1.rb
@@ -1,7 +0,0 @@
-# Read about factories at http://github.com/thoughtbot/factory_girl
-
-Factory.define :<%= singular_name %> do |f|
-<% for attribute in attributes -%>
- f.<%= attribute.name %> <%= attribute.default.inspect %>
-<% end -%>
-end
View
9 lib/generators/factory_girl/model/templates/fixtures.2.rb
@@ -1,9 +0,0 @@
-# Read about factories at http://github.com/thoughtbot/factory_girl
-
-FactoryGirl.define do
- factory :<%= singular_name %> do
- <% for attribute in attributes -%>
- <%= attribute.name %> <%= attribute.default.inspect %>
- <% end -%>
- end
-end
View
22 test/lib/generators/factory_girl/model_generator_test.rb
@@ -1,22 +0,0 @@
-require 'test_helper'
-
-class FactoryGirl::Generators::ModelGeneratorTest < Rails::Generators::TestCase
- destination File.join(Rails.root)
- tests Rails::Generators::ModelGenerator
- arguments %w(Account name:string age:integer -r factory_girl)
-
- setup :prepare_destination
- setup :copy_routes
-
- test "invoke when fixture replacement is given" do
- run_generator
- assert_file "test/factories/accounts.rb"
- assert_no_file "test/fixtures/accounts.yml"
- end
-
- test "invoke when fixture replacement is given with custom dir" do
- content = run_generator %w(Account name:string age:integer -r factory_girl --dir custom/factories)
- assert_file "custom/factories/accounts.rb"
- assert_no_file "test/fixtures/accounts.yml"
- end
-end
View
1  test/test_helper.rb
@@ -51,7 +51,6 @@ def generator_list
:erubis => ['scaffold'],
:simple_form => ['scaffold'],
:formtastic => ['scaffold'],
- :factory_girl => ['model'],
:authlogic => ['session'],
:koala => ['install'],
:shoulda => ['controller', 'scaffold']
Please sign in to comment.
Something went wrong with that request. Please try again.