From fccb7523008daca92eaec0100742b0a023ce5cbb Mon Sep 17 00:00:00 2001 From: Akshay Vishnoi Date: Wed, 28 May 2014 03:37:48 +0530 Subject: Add test case for clear mappings --- .../test/cases/connection_adapters/type/type_map_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/connection_adapters/type/type_map_test.rb b/activerecord/test/cases/connection_adapters/type/type_map_test.rb index 3abd7a276e..e85bbc8dc7 100644 --- a/activerecord/test/cases/connection_adapters/type/type_map_test.rb +++ b/activerecord/test/cases/connection_adapters/type/type_map_test.rb @@ -125,6 +125,16 @@ module ActiveRecord assert_equal mapping.lookup(3), 'string' assert_kind_of Type::Value, mapping.lookup(4) end + + def test_clear_mappings + time = Time.new + mapping = TypeMap.new + + mapping.register_type(/time/i, time) + mapping.clear + + assert_not_equal mapping.lookup('time'), time + end end end end -- cgit v1.2.3