search for: stub_render

Displaying 8 results from an estimated 8 matches for "stub_render".

2007 Jun 27
3
template.expect_render
...d partials and mocking :object and :collection in partials. template.expect_render wraps part of ''spec/mocks'', but not the whole framework - so we get the expectation matching benefit w/o conflicting with other mock frameworks that ppl might choose to use. There is also template.stub_render(opts) in case you just want to stub the render w/o verification. I would LOVE it if some of you would try this method out and provide feedback before we release it. Please feel to ask any questions about this on this list. Thanks, David
2007 Aug 14
12
expect_render, why does there need to be a warning
There is a warning on the web site about expect_render and stub_render: "WARNING: expect_render and stub_render, while very useful, act differently from standard Message Expectations (a.k.a. mock expectations), which would never pass calls through to the real object. This can be very confusing when there are failures if you''re not aware of this fact, be...
2007 Oct 20
14
Problems with form_for and partials
...al in controller_name/_form. Here''s the first form # app/views/common/form <% form_for ... do |f| -%> <%= render :partial => "params[:controller]/form", :object => f %> <p>Submit buttons...</p> <% end -%> I''m having problems with stub_render because of the :object => f. I have tried creating a FormBuilder instance to use there as the :object but it doesn''t seem to want to match the actual instance there, which has a large amount of additional information due to the template being run at that point. Then in the partial: #...
2008 Jan 23
4
expect_render(...).and_return(''x'')
Hi, I''m trying to spec a controller method which renders some rjs as part of a render :update block. The problem I''m having is that stub_render or expect_render don''t seem to allow and_return to work. The controller method does: if @thing.save render :update do |page| page.insert_html :bottom, ''x_thing_list'', :partial => ''thing'', :object...
2008 Mar 11
1
view spec on rails questions
...content_for block I see reference to it in the release notes but dont know where to find it (tried http://rspec.info/rdoc-rails/ ) 2) I dont seem to be able to stub partials in a different directory eg <%= render :partial => "foos/show" %> And I put this in the spec template.stub_render(:partial => "foos/show") the stub gets ignored and the partial still gets rendered It works fine with partials in the same directory I''m runing rspec 1.1.3 thanks linoj
2008 Jun 02
1
Cherry-picking mocks?!
A colleague just came in and asked me about a problem he was having with stub_render, which reminded me of another issue he had a week or so ago, which seems related. Let me start with the earlier issue. He was trying to write specs for a method which sends the same message possibly multiple times, but with different arguments under different calling conditions. He wanted to writ...
2009 Mar 15
0
rspec-rails 1.2.0 Released
...ithub.com/dchelimsky/rspec/upgrades for information about upgrading. IMPORTANT: This release includes the following backwards-compatibility-breaking changes. * rspec-rails supports rails 2.0.5, 2.1.2 and 2.2.2, and 2.3.1 * We are no longer supporting 1.x versions of rails. * expect_render and stub_render have been removed. * Both of these methods were deprecated in rspec-rails-1.1.5, released in Sept, 2008. * { route_for(args).should == "/path" } now delegates to assert_generates (in rails) * see Upgrade.markdown for more information * deprecations * controller.use_rails_error_...
2007 Nov 20
3
How to test views with Nested Resources and Partials
...licates this is the nested routing and how to account for it, and that there is a partial form (_form.haml) that both the edit.haml and new.haml views use (app/views/line_items). My spec keeps failing and it seems to be from a routing issue. I''m pretty sure template.expect_render/template.stub_render should be in there somewhere, but that just generates more errors. I am running edge rails and edge rspec. My other spec''s are working fine. See the output from running the spec and the associated files below (edit.haml_spec.rb, edit.haml, _form.haml) Thanks for your help, Troy #######...