Results 1 to 2 of 2
Thread: Are these tests the same?
Nov 3, 2009, 13:42 #1
- Join Date
- Nov 2009
- 0 Post(s)
- 0 Thread(s)
Are these tests the same?
(this is a cross-post from Rails Forums that I haven't been able to get an answer too yet)
I noticed that the generated test when using script/generate vs. what's in the book "Simply Rails 2", that both of these tests pass fine.
Are both the correct way of writing assertions, or has one replaced the other?
Simply Rails 2
def test_should_not_be_valid_without_name s = Story.create(:name => nil, :link => 'link') assert s.errors.on(:name) end
test "Should not be valid without a name" do s = Story.create(:name => nil, :link => 'link') assert s.errors.on(:name) end