What about overriding method_missing in the shared example group that will
make conversions:

post_XXXX -> post :XXXX
put_XXXX -> put :XXXX

etc.

David posted thoughts on the before/after stuff, which is similar to what I
do :
http://blog.davidchelimsky.net/articles/2007/11/06/before_action-after_action

I do like having the before/after part, too, as it is nice to pass a block
in occasionally.

-Corey

On Sun, Mar 9, 2008 at 6:46 AM, David Chelimsky <[EMAIL PROTECTED]>
wrote:

> On Sat, Mar 8, 2008 at 11:06 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> > I've always used do_post/do_put etc. But your way is perfectly
> acceptable :)
>
> That's what I do too - but I like Zach's idea here. Do you guys think
> the generated examples should use this?
>
> David
>
> >
> >  Pat
> >
> >
> >
> >  On 3/8/08, Zach Dennis <[EMAIL PROTECTED]> wrote:
> >  > I'm heading out of town, but had a quick thought I wanted to share.
> >  > Rather then using ambiguous named request helpers in controller specs
> >  > like "do_request", I've been using more readable helpers like
> >  > "post_create".
> >  >
> >  > For example...
> >  >
> >  > describe ProjectController do
> >  > def post_create
> >  > post :create, ...
> >  > end
> >  >
> >  > before do
> >  > end
> >  >
> >  > it "creates a new project" do
> >  > Project.should_receive(:create).with(....)
> >  > post_create
> >  > end
> >  >
> >  > end
> >  >
> >  > IMO is adds a little more readability when looking at an individual
> >  > "it" behavior on a controller spec. We've been keeping the request
> >  > helpers as the first things immediately following a controller
> >  > specification, ie: "describe SomeController do".
> >  >
> >  > Thoughts?
> >  >
> >  > --
> >  > Zach Dennis
> >  > http://www.continuousthinking.com
> >  > _______________________________________________
> >  > rspec-users mailing list
> >  > rspec-users@rubyforge.org
> >  > http://rubyforge.org/mailman/listinfo/rspec-users
> >  >
> >  _______________________________________________
> >  rspec-users mailing list
> >  rspec-users@rubyforge.org
> >  http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
http://www.coreyhaines.com
The Internet's Premiere source of information about Corey Haines
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to