[rspec-users] acts_as_authenticated error with Object#id

David Chelimsky dchelimsky at gmail.com
Wed Feb 28 22:54:35 EST 2007


On 2/28/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> On 3/1/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).
> >
>
> Or use mock_model(SomeClass) and get it for free. It also takes care
> of stubbing #to_param, which is heavily used by ActionPack.

Here's the deets on that:

http://rspec.rubyforge.org/rdoc-rails/classes/Spec/Rails/Runner/EvalContext.html

>
> Aslak
>
> > 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
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list