1

When I first learned Rails, the tutorial suggested I use RSpec. After evaluating my code, Test::Unit seems like a better fit. But my application is already built up, how do I revert the command:

rails new my_app --skip-test-unit

without destroying/redoing my application?

ovatsug25
  • 7,786
  • 7
  • 34
  • 48

1 Answers1

1

Uncomment the following line in config/application.rb

  require "rails/test_unit/railtie"

and remove rspec from Gemfile.

You will probably have to make a test directory. As well, you will need to add all the relevant details and files from here for all those other things that weren't automagically generated. Check out the latest for Rails testing here:

http://guides.rubyonrails.org/testing.html

mkdir test
cd test
mkdir fixtures functional integration

and so on to make up for the non-generated files.

This page helped to get the answer:

Ruby on Rails: Switch from test_unit to rspec

Community
  • 1
  • 1
ovatsug25
  • 7,786
  • 7
  • 34
  • 48
  • Thanks for answering your own question! This is exactly what I needed, and I only found it here. – odigity Nov 05 '13 at 14:53