[rspec-users] Missing model attribute in cucumber test

aslak hellesoy aslak.hellesoy at gmail.com
Wed Jan 14 14:52:23 EST 2009


On Wed, Jan 14, 2009 at 7:56 PM, James Byrne <lists at ruby-forum.com> wrote:

> James Byrne wrote:
>
> > Then I see this error:
> >
> >     And the user named "newuser" is an administrator     #
> > features/app/models/users/step_definitions/user_steps.rb:24
> >       undefined method `user_administrator' for #<User:0x2ac26fa83e80>
> > (NoMethodError)
> >
> /usr/lib64/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:260:in
> > `method_missing'
> >       ./features/app/models/users/step_definitions/user_steps.rb:26:in
> > `And /user named "(.*)" is an administrator/'
> >       features/app/models/users/user.feature:29:in `And the user named
> > "newuser" is an administrator'
> >
> >
> > Have I misspelled something somewhere and just cannot see it?  what is
> > causing this?
>
> I have changed the type to string and get the same error.  I have
> changed the attribute name to useradministrator and still get the same
> error.


Some things you can try

* Open a raw database session against the test db and look at tables and
columns
* script/runner "p User.column_names" -e test
* script/runner "p User.column_names" -e development


> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090114/fe50df64/attachment-0001.html>


More information about the rspec-users mailing list