[rspec-users] Scope and specing models
dchelimsky at gmail.com
Mon Aug 13 01:39:05 EDT 2007
On 8/12/07, David Parker <nemo7467 at gmail.com> wrote:
> Hello all, I'm currently having an issue with some specs, specifically scope
> issues (probably more of a scope issue than a spec issue at this point)...
> Here's the error:
> ActiveRecord::AssociationTypeMismatch in 'A new User should
> know what role it has'
> Role expected, got NilClass
> Here's the user.rb
> The code is based off of RESTful authentication +
> Ben Curtis' user roles in Rails Application:
users.roles is an AssociationProxy, not the Role class, where you have
defined the method add(user, role). You should be able to eliminate
that method in the Role class and just pass the role on line 62 of
> Thanks for your help!
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users