[rspec-users] ridding away with do_request
David Chelimsky
dchelimsky at gmail.com
Sun Mar 9 07:46:39 EDT 2008
On Sat, Mar 8, 2008 at 11:06 PM, Pat Maddox <pergesu at gmail.com> 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 <zach.dennis at gmail.com> 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 at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list