Permalink
Browse files

Assert the query result instead of checking for nothing raised

Nothing should be raised anyway 😄

Thanks @spastorino ❤️
https://github.com/rails/rails/pull/8202/files#r2112067
  • Loading branch information...
1 parent 087150d commit 9ad8d670ec53eab64f0e0f0a248c2b11ebd79cc8 @carlosantoniodasilva carlosantoniodasilva committed Nov 13, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 activerecord/test/cases/finder_test.rb
@@ -611,10 +611,8 @@ def test_find_by_one_attribute_that_is_an_alias
end
def test_find_by_one_attribute_bang_with_blank_defined
- BlankTopic.create(title: "The Blank One")
- assert_nothing_raised do
- BlankTopic.find_by_title!("The Blank One")
- end
+ blank_topic = BlankTopic.create(title: "The Blank One")
+ assert_equal blank_topic, BlankTopic.find_by_title!("The Blank One")
end
def test_find_by_one_attribute_with_conditions

1 comment on commit 9ad8d67

Owner

spastorino commented on 9ad8d67 Nov 14, 2012

❤️

Please sign in to comment.