[rspec-users] How to use rspec_scaffold generator with latest rspec gem.

David Chelimsky dchelimsky at gmail.com
Thu Mar 10 09:58:33 EST 2011

On Mar 10, 2011, at 7:49 AM, Mohnish J. wrote:

> Hi,
> 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 at mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g
> rspec_scaffold post title:string body:text
>    Could not find generator rspec_scaffold.
>    mohnish at 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.

rails generate rspec:install
rails generate scaffold

In Rails 3, once you run the rspec:install generator, the Rails generators delegate out to rspec-rails to generate the spec files.

You might also want to check out http://ruby.railstutorial.org/.


More information about the rspec-users mailing list