Making webrat's visit() method send via PUT (or DELETE, or whatever)

82 views
Skip to first unread message

doug livesey

unread,
Nov 5, 2009, 10:03:39 AM11/5/09
to web...@googlegroups.com
Hi -- is it possible to get Webrat's visit() method to send as a PUT request?
Sort of like: visit( path_to( "home page" ), :method => :put )
But not like that, as that doesn't work.
Cheers,
   Doug.

Damian Janowski

unread,
Nov 5, 2009, 10:18:28 AM11/5/09
to web...@googlegroups.com

Users are not able to visit a website using a verb different than GET,
so using visit via PUT doesn't make sense.

doug livesey

unread,
Nov 5, 2009, 10:26:13 AM11/5/09
to web...@googlegroups.com
Should've spent a bit more time playing -- this did it:
visit_path( path_to( "home page" ), :put )

Kickass!
   Doug.

2009/11/5 doug livesey <bio...@gmail.com>

adamonrails

unread,
Nov 5, 2009, 5:22:13 PM11/5/09
to webrat
Out of interest, how has the need to do this arrised? Or are you using
Cucumber for some nefarious purpose that has nothing to do with BDD?

Ad.

On Nov 5, 3:26 pm, doug livesey <biot...@gmail.com> wrote:
> Should've spent a bit more time playing -- this did it:
> visit_path( path_to( "home page" ), :put )
>
> Kickass!
>    Doug.
>
> 2009/11/5 doug livesey <biot...@gmail.com>

Zach Dennis

unread,
Nov 11, 2009, 8:05:06 PM11/11/09
to web...@googlegroups.com
On Thu, Nov 5, 2009 at 5:22 PM, adamonrails
<electronicb...@gmail.com> wrote:
>
> Out of interest, how has the need to do this arrised? Or are you using
> Cucumber for some nefarious purpose that has nothing to do with BDD?

I don't know how it's arised for Doug, but your question insinuates
that what Doug is using it for is *obviuosly* not BDD. We have used it
several times and I assure you we run a BDD ship. :)

Zach

>
> Ad.
>
> On Nov 5, 3:26 pm, doug livesey <biot...@gmail.com> wrote:
>> Should've spent a bit more time playing -- this did it:
>> visit_path( path_to( "home page" ), :put )
>>
>> Kickass!
>>    Doug.
>>
>> 2009/11/5 doug livesey <biot...@gmail.com>
>>
>> > Hi -- is it possible to get Webrat's visit() method to send as a PUT
>> > request?
>> > Sort of like: visit( path_to( "home page" ), :method => :put )
>> > But not like that, as that doesn't work.
>> > Cheers,
>> >    Doug.
> >
>



--
Zach Dennis
http://www.continuousthinking.com (personal)
http://www.mutuallyhuman.com (hire me)
http://ideafoundry.info/behavior-driven-development (first rate BDD training)
@zachdennis (twitter)
Reply all
Reply to author
Forward
0 new messages