I am driving out a view and I want to test that a link is displayed.

The link_to code for the link is included in the layout for the view
rather than the view template itself.

Here's my example:

  it "should display a link to create a new zone" do
    render "contexts/index.html.erb", :layout => "layouts/
contexts.html.erb"
    response.should contain("sign out")
  end

Firstly, my experiments suggest that the layout is only rendered if
the :layout attribute is included in the call to render. Is my
understanding correct?

Secondly, the link_to code only executes if the session contains a
piece of data (member id). How do I set up the session data in my view
spec?

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

Reply via email to