search for: do_render

Displaying 6 results from an estimated 6 matches for "do_render".

2008 Aug 08
2
template.expect_render fails when partial is rendered from a helper
My spec; describe ''subnav rendering while logged in'' do before do template.stub!(:logged_in?).and_return(true) template.stub! (:current_profile).at_least(:once).and_return(mock_profile) end def do_render render "/homepages/show.html.erb" end it "should render the logged in partial for homepages" do template.expect_render(:partial => ''shared/subnav/home'', :locals => {:active => :home}) do_render end end passes if I ren...
2007 May 17
4
How to mock helpers in view specs ?
...egory] @controller.stub!(:current_user?).and_return(false) @controller.stub!(:current_user).and_return(mock("mock user")) end it "should only render forums accessible to anonymous users" do @forums_proxy.should_receive(:readable_by).with(nil).and_return([]) do_render end def do_render render "forum_categories/index" end end What am I doing wrong ? This is on RSpec 0.9.4 and RSpec on Rails 0.9.4. Thanks ! -- Fran?ois Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/
2007 Dec 04
0
shared behaviour for all views
...ta tags, and an h1? Here''s an idea for a shared behaviour (that only applies if I set views to use it manually with it_should_behave_like "a standard layout"): describe "a standard layout", :shared => true do it "should have meta tags" do do_render response.should have_tag("meta") end it "should have an h1 tag" do do_render response.should have_tag("h1") end end Note that this also sucks because I currently have to define a do_render that calls render with a stringified n...
2008 Apr 19
4
Is testing output within content_for possible?
I wanted to test that the links below were being rendered in the views. - content_for :sidebar do %ul.links %li= edit_link edit_admin_contact_url(@contact), "Contact" # view test it "should have the correct side bar links" do do_render response.should have_tag("ul.links") do with_tag("a[href=?]", edit_admin_account_url(accounts(:test))) end end The above doesn''t work. Just to make sure my tests weren''t the issue I removed the content_for block and the tests then pass...
2007 Jul 14
8
Specing Layouts
Hi, I''ve just started to try and spec my application.html.erb layout as one of the view specs but it totally barfs. I''m guessing that it''s due to the yield statements in the layout. Any clues as to how to proceed? Cheers Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL:
2008 Mar 18
11
"Why not MockEverthing" or why use fixtures for all tests?
Hello fellow RSpec users. Before you all start warming up your flame throwers please let me explain my Subject line. I''ve been working over 4 months on a large Rails project with a few other developers. Test coverage was spotty at best, though they *were* RSpec tests. One of the other developers and I had started adding more tests, mostly controller tests using the methodology