Is there a way to test that a model has a specific attribute? Right now I am just using respond_to
like this:
describe Category do
it { should respond_to(:title) }
...
end
to test that the Category model has an attribute, but that only really tests that there is an instance method called title
. However, I can see how in some situations they would behave synonymously.