[rspec-users] rspec - rails put :update any examples

David Chelimsky dchelimsky at gmail.com
Tue Feb 5 02:02:02 EST 2008


On Feb 4, 2008 9:44 PM, Brian Rowe <brianmrowe at 7effect.com> wrote:
> I'm looking for a working example of a put :update on a controller.  The
> documentation online avoids the update function.
>
> Any help pointing to this example would be great.  Trying to get to 100%
> coverage...can't make it without update :)

This is what I do:

it "should replace foo with bar partial" do
  page = mock("page")
  page.should_receive(:replace_html).with('foo', :partial => 'bar')
  controller.expect_render(:update).and_yield(page)
  do_post
end

HTH,
David

>
> Brian
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list