aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/geometric_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-05-16 09:44:49 -0400
committerSean Griffin <sean@seantheprogrammer.com>2016-05-16 09:44:49 -0400
commite9cf20087b8db56f97c5dabbcccba6186df9648b (patch)
tree68eb8f1145b8c1eee30eac5ad671f0ba05f22ab8 /activerecord/test/cases/adapters/postgresql/geometric_test.rb
parente35b98e6f5c54330245645f2ed40d56c74538902 (diff)
parente3cd321d4bbf7e76ed72507bd991011daf8516d0 (diff)
downloadrails-e9cf20087b8db56f97c5dabbcccba6186df9648b.tar.gz
rails-e9cf20087b8db56f97c5dabbcccba6186df9648b.tar.bz2
rails-e9cf20087b8db56f97c5dabbcccba6186df9648b.zip
Merge pull request #25023 from slbug/patch-1
Rails 5.1 point type should not raise exception if empty string is provided as input
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/geometric_test.rb')
-rw-r--r--activerecord/test/cases/adapters/postgresql/geometric_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/geometric_test.rb b/activerecord/test/cases/adapters/postgresql/geometric_test.rb
index 9e250c2b7c..66f0a70394 100644
--- a/activerecord/test/cases/adapters/postgresql/geometric_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/geometric_test.rb
@@ -104,6 +104,13 @@ class PostgresqlPointTest < ActiveRecord::PostgreSQLTestCase
assert_equal ActiveRecord::Point.new(1, 2), p.x
end
+ def test_empty_string_assignment
+ assert_nothing_raised { PostgresqlPoint.new(x: "") }
+
+ p = PostgresqlPoint.new(x: "")
+ assert_equal nil, p.x
+ end
+
def test_array_of_points_round_trip
expected_value = [
ActiveRecord::Point.new(1, 2),