[rspec-users] Example for attr_accessible?

Steve vertebrate at gmail.com
Tue Oct 16 14:50:38 EDT 2007


On Tue, 16 Oct 2007 13:43:43 -0500, David Chelimsky wrote:

> On 10/16/07, Pat Maddox <pergesu at gmail.com> wrote:
>> describe Chicken do
>>   it "should make only :name and :age attr_accessible" do
>>     Chicken.should_receive(:attr_accessible).with(:name, :age)
>>     load "#{RAILS_ROOT}/app/models/chicken.rb"
>>   end
>> end
>>
>> I first saw this technique described by David Chelimsky at
>> http://rubyforge.org/pipermail/rspec-users/2007-September/002965.html
> 
> Which I first saw described by Jay Fields at
> http://blog.jayfields.com/2006/12/rails-unit-testing-activerecord.html

Sweet, thanks guys. That's exactly what I was looking for.



More information about the rspec-users mailing list