On Jul 12, 4:35 am, Chandu80 <[email protected]> wrote: > Hello All, > > *************************************************************************** > ******* > 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.?
Check out http://rspec.info/rails/writing/controllers.html Basically you need to do a get or post (in your case probably post :createchannel) and then there's a response object you can have expectations on, such as response.should render_template('createchannel.html'). Note, I'm not really sure what the ChannelsController.expect_render(...) does, I'm unfamiliar with that syntax. Thanks, \Peter -- 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.

