how to rspec generate in rails? i also install plugin for rspec.. i also install gem rspec,rspec-rails.. now what can i do??
4 Answers
Came here with the same question, and Don's answer got me on the right path. The generators however have : instead of _ in the name for Rails 3:
> rails g rspec:controller soa/user
create spec/controllers/soa/user_controller_spec.rb
> rails g rspec:scaffold soa/user
create spec/controllers/soa/users_controller_spec.rb
create spec/views/soa/users/edit.html.erb_spec.rb
create spec/views/soa/users/index.html.erb_spec.rb
create spec/views/soa/users/new.html.erb_spec.rb
create spec/views/soa/users/show.html.erb_spec.rb
invoke helper
create spec/helpers/soa/users_helper_spec.rb
create spec/routing/soa/users_routing_spec.rb
invoke rspec
create spec/requests/soa/soa_users_spec.rb
Annoyingly, these are not listed when you run rails g but they are available.