Can someone please explain to me why this spec fails
it "should work" do
template.stub!(:render)
template.should_receive(:render).with(:partial => "foo")
render @template_with_render_partial_foo
end
but this spec passes
it "should work" do
@foo.stub!(:bar)
@foo.should_receive(:bar).wit
Per David's request i made a pastie of the whole view and the whole test of
an example of this. as well as the output. http://pastie.org/309868
RSL
On Fri, Nov 7, 2008 at 5:17 PM, Russell Norris <[EMAIL PROTECTED]>wrote:
> Zach,
>
> Thank you so much. That works for me.
&g
PM, Zach Dennis <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 7, 2008 at 4:35 PM, Russell Norris <[EMAIL PROTECTED]>
> wrote:
> > Can someone please explain to me why this spec fails
> >
> > it "should work" do
> >
> > template.stub!(
rious things that you may want - so we changed to
> have_association to make it simpler and ensure it will work with any/all
> association options
>
> http://pastie.caboo.se/108976
>
>
>
>
>
> Russell Norris wrote:
> > I recently wrote a matcher for testing AR assoc
conditions => "stuff", :through
> > => :bazes)
> >
> > we started off with should have_many etc, but it became overcomplicated
> > with all the various things that you may want - so we changed to
> > have_association to make it simpler and ensure it wi
I recently wrote a matcher for testing AR associations which allows
you to specify things like:
Foo.should have_many(:bars).through(:bazes)
I'm pretty darned proud of it and a couple of people have suggested
that I should submit it to the rspec_on_rails project. Before I go to
the trouble of
i'm having problem with a form_for situation where i'm trying to DRY
out the repeated parts of my forms and put them in common/form and
render the form elements via another partial in controller_name/_form.
Here's the first form
# app/views/common/form
<% form_for ... do |f| -%>
<%= render :part
different Proc than the form builder in the code. I'm giving up
trying to solve that and just not specing it to expect_render(...). So
I'm gonna consider this problem solved and move on. :)
RSL
On 10/20/07, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On 10/20/07, Russell Norris <[E
Howdy. I've been handling this by simply stubbing out the methods as
needed in the before(:each) block and then stating
should_receive(:foo) when i'm actually writing spec for their
behavior.
RSL
On 11/1/07, Hans de Graaff <[EMAIL PROTECTED]> wrote:
> One thing that is bothering me about my contr