On 8/16/07, David Chelimsky <[EMAIL PROTECTED]> wrote:
>
> On 8/15/07, Courtenay <[EMAIL PROTECTED]> wrote:
> > On 8/15/07, Priit Tamboom <[EMAIL PROTECTED]> wrote:
>
> > > describe ApplicationController do
> > >    it "method login_required should redirect to home path without
> login" do
> >
> > heh.  "it" is so out of place here :)
>
> I agree. The goal is to describe behaviours of objects, not methods.
> So, I'd write:
>
> it "should redirect anonymous user to home path"
>
> Cheers,
> David
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>


Thanks for great answers!

By the way, David, your blog post was good additional help about what to do
with application methods:
http://blog.davidchelimsky.net/articles/2007/06/03/oxymoron-testing-behaviour-of-abstractions

I wonder how far you go just testing "concrete" controllers. For example, if
I move login methods from application controller to module under lib
directory then do you change your style (write separate spec for module) or
just keep testing concrete controllers as usually you do.

Oki,
Priit
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to