[rspec-users] acts_as_authenticated error with Object#id

Kevin Williams kevwil at gmail.com
Thu Mar 1 09:34:08 EST 2007


No, this isn't a mock AFAIK. The 'login_as(:quentin)' code uses the
data from the fixtures, so it should be loading from the test
database.

On 2/28/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 2/28/07, Kevin Williams <kevwil at gmail.com> wrote:
> > I'm getting this when I run my Rails controller specs.
> >
> > <projectroot>/config/../lib/authenticated_system.rb:16: warning: Object#id
> > will be deprecated; use Object#object_id
> >
> > I added "include AuthenticatedTestHelper" to /spec/spec_helper.rb so
> > that my controller tests^H^H^H^H^Hspecs can use the "login_as" helper
> > method. Anyone know how to fix this?
>
> This usually comes from something calling #id on a mock of a model.
> Are you mocking any AR models? If so, be sure to
> stub!(:id).and_return(a_string).
>
> David
>
> >
> >
> > --
> > Cheers,
> >
> > Kevin Williams
> > http://www.almostserio.us/
> >
> > "Any sufficiently advanced technology is indistinguishable from
> > Magic." - Arthur C. Clarke
> > _______________________________________________
> > 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
>


-- 
Cheers,

Kevin Williams
http://www.almostserio.us/

"Any sufficiently advanced technology is indistinguishable from
Magic." - Arthur C. Clarke


More information about the rspec-users mailing list