Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Validating Presence Error

I'm continue to get the following error reqardless of if I use validate or validates...

1) Error: test_a_user_should_enter_a_first_name(UserTest): NoMethodError: undefined method error' for #<User:0x0000000341b4c0> /home/matt/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1/gems/activemodel-3.2.6/lib/active_model/attribute_methods.rb:407:inmethod_missing' /home/matt/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/attribute_methods.rb:149:in method_missing' test/unit/user_test.rb:7:inblock in <class:UserTest>'

Can anyone help? Jason Seifer Jim Hoskins

2 Answers

Jim Hoskins
STAFF
Jim Hoskins
Treehouse Guest Teacher

If you could post both your user class file and your test file into a gist and post the link here that would help all of use help you. (https://gist.github.com/)

By looking at the stack trace you've posted, it says you are trying to call the error method which is undefined. This is usually a hint you mistyped something, or forgot to define the method yourself. In this case I would guess you meant errors where you put error.

Seems like a problem with line 7 in UserTest. Can you copy the code around there and share it with us?