Hi All,
I am writing specs for View, that has a menu (which is in a partial) rendered in layout. I want to write specs for selected menu. Here is the code
it "should have User Administration link" do
template.stub!(:render).and_return(:partial => "layouts/admin/menu")
do_render
#render :partial => "layouts/admin/menu" #do
response.should have_tag('div.menu1')
response.should have_tag('ul') do
response.should have_tag('li')do
with_tag("a[href=?]", admin_users_path)
end
end
end
This spec is failing. I am not getting right way to write specs for partials, I have tried with:
template.should_receive(:render).with(:partial => "/layout/admin/menu")
too.
Thanks and regards, Pravin.