Last Updated: February 25, 2016
·
912
· jan0sch

Configure test frameworks and fixture replacements in rails

If you want to use another test framework for rails like rspec and factories instead of fixtures. You should adapt config/application.rb as follows:

config.generators do |g|
  g.test_framework :rspec               # Use RSpec as testing framework.
  g.fallbacks[:rspec] = :test_unit      # Fallback to Test-Unit if RSpec is not available.
  g.fixture_replacement :factory_girl   # Use FactoryGirl instead of fixtures.
end