Hi Tim,

I'm just a newb too, but as I understand it, you should only spec code you write. In the case of attributes on models, it's ActiveRecord code. You shouldnt need to test that. I have not been doing this.

That said, I'd love to get the word from some people that have been doing it for a while.

--
Matt Berther
http://www.mattberther.com




On Mar 31, 2008, at 6:21 PM, Tim Haines wrote:

Hi there,

A couple of complete newb questions here.

Should I be spec'ing the existence of attributes on models? While reading through the docs and googling I haven't seen any example that checks if attributes exist on a model. i.e. Game.Description.

Likewise, what I've seen on spec'ing associations seems light. What spec should I be writing before I add a belongs_to :genre to my game model? The closest I've seen is probably this -> http://blog.imperialdune.com/2007/2/27/rspec-ing-model-associations

Cheers,

Tim.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to