Within my project, I have a number of models that have additional
within them other than those provided by active record.
as an example (to keep it short and sweet)
class foo < ActiveRecod::Base
in my spec file I have
describe Foo do
@foo = Foo.new()
it “should have a status of New Record”
@foo.status.should == “New Record”
it “should have a status of Reset after reset”
@foo.reset.should == “Reset”
however, when I run rake spec I get
NoMethodError in ‘Foo should have a status of New Record’
undefined method ‘status’ for #<Hash…>
and an equivalent one for the other method.
I am sure that this is something fundamental in my understanding, but
scuppered. I have spent the best part of a day trying to resolve this.
- Why are my methods undefined, when they are there (I can create the
object via script/console and call the status and reset methods and see
- What is the best way of resolving the issue