diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-10 14:17:35 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-10 15:45:47 -0700 |
commit | ac6e6545de378cbd86c854884806b46f6fd33247 (patch) | |
tree | ce78d81fff23fed7aa211c44088f356c728b7e57 /activerecord | |
parent | 268ee64e6362467fc6d2e54df703c620af78f5fb (diff) | |
download | rails-ac6e6545de378cbd86c854884806b46f6fd33247.tar.gz rails-ac6e6545de378cbd86c854884806b46f6fd33247.tar.bz2 rails-ac6e6545de378cbd86c854884806b46f6fd33247.zip |
Stop passing a column to `quote` in tests
I'm planning on deprecating the column argument to mirror the
deprecation in [arel].
[arel]: https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/quoting_test.rb | 9 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/quoting_test.rb | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/quoting_test.rb b/activerecord/test/cases/adapters/postgresql/quoting_test.rb index 9ac0036d66..894cf1ffa2 100644 --- a/activerecord/test/cases/adapters/postgresql/quoting_test.rb +++ b/activerecord/test/cases/adapters/postgresql/quoting_test.rb @@ -34,13 +34,14 @@ module ActiveRecord def test_quote_range range = "1,2]'; SELECT * FROM users; --".."a" - c = PostgreSQLColumn.new(nil, nil, OID::Range.new(Type::Integer.new, :int8range)) - assert_equal "'[1,0]'", @conn.quote(range, c) + type = OID::Range.new(Type::Integer.new, :int8range) + assert_equal "'[1,0]'", @conn.quote(type.type_cast_for_database(range)) end def test_quote_bit_string - c = PostgreSQLColumn.new(nil, 1, OID::Bit.new) - assert_equal nil, @conn.quote("'); SELECT * FROM users; /*\n01\n*/--", c) + value = "'); SELECT * FROM users; /*\n01\n*/--" + type = OID::Bit.new + assert_equal nil, @conn.quote(type.type_cast_for_database(value)) end end end diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb index df497e761c..274e358e4a 100644 --- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb @@ -85,9 +85,9 @@ module ActiveRecord def test_quoting_binary_strings value = "hello".encode('ascii-8bit') - column = Column.new(nil, 1, SQLite3String.new) + type = SQLite3String.new - assert_equal "'hello'", @conn.quote(value, column) + assert_equal "'hello'", @conn.quote(type.type_cast_for_database(value)) end end end |