Hello All,
I am a rspec beginner and I am trying to find a way out to write
render expectation in controller spec.I used the following ways
render '/channels/createchannel.html.erb'
view.should_receive(:render).with(:action => "createchannel")
ChannelsController.expect_render(:action => "createchannel")
ChannelsController.render_template(:action => "createchannel")
controller.expect_render(:action => "createchannel")
controller.render_template(:action => "createchannel")

All fail giving a NoMethodError

**********************************************************************************
My spec is as follows

require File.dirname(__FILE__) + '/../spec_helper'

describe ChannelsController do
  it "should re-direct to create channel" do
    Channel.stub!(:checkChannel?).and_return(1)
    ChannelsController.expect_render(:action => "createchannel")

    #view.should_receive(:render).with(:action => "createchannel")
    #render '/channels/createchannel.html.erb'
  end


end
**********************************************************************************


Can anyone please let me know how this can be fixed.?


Thanks & Regards
Chandrika

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to