I am new to rSpec and I am writing a test for a controller which has
already been developed

This is the example in my reports_controller_spec.rb:

it "should render the layouts/menu template" do
   get :select_missing_persons
   response.should render_template("layouts/menu")
 end

and this is the method in the reports_controller.rb

def select_missing_identifiers
   render(:layout => "layouts/menu")
 end

I am getting the following output when running autotest:

'ReportsController should render the layouts/menu template' FAILED
expected "layouts/menu", got "reports/select_missing_persons"
./spec/controllers/reports_controller_spec.rb:39:
script/spec:4:

Here, I was trying to test if the out put displays with a layouts/menu
template.
Can somebody help on how you test the render(:layout => "layouts/
menu") statement in a controller or this is supposed to be tested in
the view?





begin:vcard
fn:Dave Gamphani Phiri
n:Gamphani Phiri;Dave
email;internet:[EMAIL PROTECTED]
tel;home:+265 8 654 187
tel;cell:+265 9 476 012
version:2.1
end:vcard

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to