I have an Active Record based model:- House
It has various attributes, but no formal_name
attribute.
However it does have a method for formal_name
, i.e.
def formal_name
"Formal #{self.other_model.name}"
end
How can I test that this method exists?
I have:
describe "check the name " do
@report_set = FactoryGirl.create :report_set
subject { @report_set }
its(:formal_name) { should == "this_should_fail" }
end
But I get undefined method 'formal_name' for nil:NilClass