aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
diff options
context:
space:
mode:
authorJoseLuis Torres <jl@joseluistorres.me>2014-06-26 22:52:01 -0500
committerJoseLuis Torres <jl@joseluistorres.me>2014-08-21 11:46:19 -0500
commitaf16fd57933e092067b8e1ff13e2553fc758be27 (patch)
tree4d05712bbf812200c33429ef33a073cb7b5063a8 /activerecord/test/cases/adapters/postgresql
parent2e355fe0c7f0e4b8a3102864191c0be83fa4c12e (diff)
downloadrails-af16fd57933e092067b8e1ff13e2553fc758be27.tar.gz
rails-af16fd57933e092067b8e1ff13e2553fc758be27.tar.bz2
rails-af16fd57933e092067b8e1ff13e2553fc758be27.zip
adding the exception RecordNotFound to UUID find
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql')
-rw-r--r--activerecord/test/cases/adapters/postgresql/uuid_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/uuid_test.rb b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
index 66006d718f..6e7920b814 100644
--- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
@@ -252,5 +252,19 @@ class PostgresqlUUIDTestInverseOf < ActiveRecord::TestCase
comment = post.uuid_comments.create!
assert post.uuid_comments.find(comment.id)
end
+
+ def test_find_with_uuid
+ UuidPost.create!
+ assert_raise ActiveRecord::RecordNotFound do
+ UuidPost.find(123456)
+ end
+
+ end
+
+ def test_find_by_with_uuid
+ UuidPost.create!
+ assert_nil UuidPost.find_by(id: 789)
+ end
end
+
end