[rspec-users] Mocking models provided in Rails plugins

Robert Evans robertrevans at gmail.com
Fri Oct 19 03:16:05 EDT 2007


Dan, you can take a look at what  *court3nay did, here:

* **
http://sample.caboo.se/empty_rails_app/trunk/spec/controllers/session_controller_spec.rb

Robert

On 10/18/07, Brandon Keepers <bkeepers at gmail.com> wrote:
>
> Dan,
>
> On Oct 18, 2007, at 6:14 PM, Dan Croak wrote:
>
> > Hey folks,
> >
> > How do I mock a model that is given to me by a Rails plugin? I'm
> > trying to mock Session from the restful_authentication plugin but I
> > get a number of errors telling me RSpec doesn't recognize Session.
> >
> > NameError in 'SessionsController handling GET /sessions/new should
> > be successful'
> > uninitialized constant Session
>
> Your problem is that the class isn't just Session, it's
> CGI::Session::ActiveRecordStore::Session
>
> Brandon
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
- Robert
http://robertrevans.com
http://rubysnips.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071019/1d29f70f/attachment.html 


More information about the rspec-users mailing list