aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/finder_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-13 14:54:47 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-13 14:54:47 -0200
commit9ad8d670ec53eab64f0e0f0a248c2b11ebd79cc8 (patch)
tree4e7043e3dc0ba39445c75e877b653cde62f41eee /activerecord/test/cases/finder_test.rb
parent087150d9b7a73f20677f9bc3ff52fe66b1f1e549 (diff)
downloadrails-9ad8d670ec53eab64f0e0f0a248c2b11ebd79cc8.tar.gz
rails-9ad8d670ec53eab64f0e0f0a248c2b11ebd79cc8.tar.bz2
rails-9ad8d670ec53eab64f0e0f0a248c2b11ebd79cc8.zip
Assert the query result instead of checking for nothing raised
Nothing should be raised anyway :smile: Thanks @spastorino :heart: https://github.com/rails/rails/pull/8202/files#r2112067
Diffstat (limited to 'activerecord/test/cases/finder_test.rb')
-rw-r--r--activerecord/test/cases/finder_test.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index f68d7de3ae..7db7953313 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -611,10 +611,8 @@ class FinderTest < ActiveRecord::TestCase
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