[rspec-users] Example for attr_accessible?

Steve vertebrate at gmail.com
Tue Oct 16 12:31:59 EDT 2007


> 
> You could expect a call to attr_accessible and then load your model file.
> 
> Or, loop through all the column names in your model, and make sure
> that only the ones that are supposed to be accessible get set.
> 
> Pat

Expecting the call is what I had originally thought of, but couldn't
figure out how to write that test. Isn't attr_accessible called when you
create a new instance, so there wouldn't be time to setup an expectation
for the call?



More information about the rspec-users mailing list