All,
I am working on getting factory_girl_rails to automatically configure
itself as the fixture replacement when it is included in a project.
I am seeing some strange behavior differences with the generators
between test unit and rspec.
When I run ''rails generate model User name:string'' with only
test unit
configured, I get the following output:
Method orm
Args [:active_record, {:migration=>true, :timestamps=>true}]
Method test_framework
Args [:test_unit, {:fixture=>true, :fixture_replacement=>nil}]
Method integration_tool
Args [:test_unit]
Method performance_tool
Args [:test_unit]
Method fixture_replacement
Args [:factory_girl]
invoke active_record
create db/migrate/20110907224210_create_users.rb
create app/models/user.rb
invoke test_unit
create test/unit/user_test.rb
create test/fixtures/users.yml
When I run the same command with rspec-rails installed, I get the
following output:
Method orm
Args [:active_record, {:migration=>true, :timestamps=>true}]
Method test_framework
Args [:test_unit, {:fixture=>true, :fixture_replacement=>nil}]
Method integration_tool
Args [:test_unit]
Method performance_tool
Args [:test_unit]
Method fixture_replacement
Args [:factory_girl]
Method integration_tool
Args [:rspec]
Method test_framework
Args [:rspec]
invoke active_record
create db/migrate/20110907224326_create_users.rb
create app/models/user.rb
invoke rspec
create spec/models/user_spec.rb
invoke factory_girl
create test/factories/users.rb
I can''t seem to figure out why RSpec seems to respect the
fixture_replacement setting set to :factory_girl but test unit does
not.
I have quickly poured over the generator code and can''t seem to find
where the disconnect is happening. I plan on spending some more time
tomorrow looking into this but thought I''d throw out a help in case
someone more familiar with the generator hooks might have an idea.
Thanks,
Mike
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.