My thought is that it verifies you're receiving the error you expected and not 
an artifact from another issue. So my intention is not to test Rails but to 
make sure my tests are doing what I'm expecting. Does that make sense or am I 
just paranoid?

On Nov 8, 2010, at 6:14 PM, Marnen Laibow-Koser wrote:

> Anthony Smith wrote in post #960202:
>> For example:
>> 
>> it 'should not validate if nil' do
>>      @account.name = nil
>>      @account.should_not be_valid
> 
> Those two lines are good practice: you're testing that the object is 
> invalid when you want it to be.
> 
>>      @account.errors[:name][0].should eq 'can\'t be blank'
> 
> That line seems unnecessary: you're testing the Rails framework, which 
> is already well tested.
> 
>> end
>> 
>> Is this good practice?
> 
> Best,
> -- 
> Marnen Laibow-Koser
> http://www.marnen.org
> [email protected]
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to