Reputation: 2341
I'm trying to set a testing framework for a rails engine. I have everything working, I generated the corresponding rspec file with:
rails g rspec:install
However everytime I want to add a rspec testing file with:
rails g integration_test blah
The RSpec doesn't take over and instead the standard unit testing framework of rails creates the corresponding files. Any thoughts on where the problem might be?
Upvotes: 2
Views: 793
Reputation: 703
you should put in application.rb:
config.generators do |g|
g.integration_tool :rspec
g.test_framework :rspec
end
source: rails configuration guide
Upvotes: 1
Reputation: 496
I solved that problem running rails g with --integration-tools option
rails g integration_test blah --integration-tools=rspec
I do not know how to set rspec as default tool.
Upvotes: 1
Reputation: 3826
I always add in my application.rb :
config.generators do |g|
g.test_framework :rspec
end
That allows RSpec to replace Rails generator for tests.
Upvotes: 1