Reputation: 7400
I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby 1.9.2 on ubuntu 10.04 os.
I am currently referring to the tutorial on :- http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework. This tutorial not only uses old plugins , but old Rails version of 2.x also.
I am unable to use the old rspec generator ( rspec_scaffold ) with rspec 2.5 and rspec-rails 2.5 gem. As expected I get the following error as given below.
mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g rspec_scaffold post title:string body:text
Could not find generator rspec_scaffold.
mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$
Could you please tell me how should I give to accordingly for it to work for me using the above RoR configuration.
Thanks
Upvotes: 1
Views: 897
Reputation: 7400
The latest Rspec gems don't require the old generator mentioned above, basically on giving rails
g in your rails app you would get all the list of generators with your app.
Thus, once you have installed the Rspec related gems, then give a rails g to your app, you need to basically run only one of the generator command from the modified list that you would get, which is rspec:install
and this would be enough to get you up & running at least with a proof of concept(poc).
Upvotes: 1