I type:
rails g rspec:controller application
But nothing appears in the spec file?
If you type script/rails generate, the only RSpec generator you'll actually see is rspec:install. That's because RSpec is registered with Rails as the test framework, so whenever you generate application components like models, controllers, etc, RSpec specs are generated instead of Test::Unit tests.
rails g rspec:integration [name]
example:
=> rails g rspec:integration controller
=> create spec/requests/controllers_spec.rb
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.