diff options
author | bUg <slbug@users.noreply.github.com> | 2016-05-15 15:00:10 +0300 |
---|---|---|
committer | Alexander Grebennik <aleks.grebennik@gmail.com> | 2016-05-15 16:14:57 +0300 |
commit | e3cd321d4bbf7e76ed72507bd991011daf8516d0 (patch) | |
tree | 890179992c61a9f0f4ae7346ca122a36b087ff41 /activerecord/test | |
parent | 0827f9932f75360dc4a7db8046d08d55055e8526 (diff) | |
download | rails-e3cd321d4bbf7e76ed72507bd991011daf8516d0.tar.gz rails-e3cd321d4bbf7e76ed72507bd991011daf8516d0.tar.bz2 rails-e3cd321d4bbf7e76ed72507bd991011daf8516d0.zip |
Rails 5.1 point type should not raise exception if empty string is provided as value
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/geometric_test.rb | 7 |
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), |