[rspec-users] Trivial controller spec fail

rodrigo benenson rodrigo.benenson at gmail.com
Thu Mar 25 06:11:07 EDT 2010

Hello RSpec community !

I'm a Ruby on Rails newby trying to get my first application running.
I already got some of the website running and now I'm writting the
tests to verify that everything works as expected and that it will
stay like that in future versions.
However I'm having a really hard time getting RSpec to run correctly.

Following the mailing list policy I have created a gist with:

system configuration.txt -> my gem list and spec version
teaser_controller.rb -> the 12 lines dummy controller
teaser_controller_spec.rb -> the 14 lines spec that fails
output.txt -> the error I get when I run "rake spec:controllers", with
its traceback


My controller does
 def index
       render :teaser_v1

def teaser_v1

My spec does
 it "renders :teaser_v1" do
     get :index

and then rake spec does
ArgumentError in 'TeaserController GET index renders :teaser_v1'
wrong number of arguments (2 for 1)

The teaser_controller just renders a static html files, no templates,
no partials, no nothing. Yet, the test fails.

I have created a side test project where I ran
ruby script/generate rspec_scaffold Stuff name:string category:name

and compared the created files with mines. But I still cannot see why
the test project specs pass, and mines do not.

Your help is very welcome.
Than you very much for creating such a nice specification tool.
I hope I will be able to use and contribute to it in the future.


More information about the rspec-users mailing list