From e4d05e1066b4a9944758578ce8a9c4391d7ddcdb Mon Sep 17 00:00:00 2001 From: Aditya Sanghi Date: Sat, 9 Oct 2010 01:19:31 +0530 Subject: [PATCH] add failing tests for time_select --- activerecord/test/cases/base_test.rb | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 16fd9a7..c1a1d2e 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -598,6 +598,24 @@ class BasicsTest < ActiveRecord::TestCase assert_equal Time.local(2004, 6, 24, 16, 24, 0), topic.written_on end + def test_multiparameter_attributes_on_time_with_ignore_date_big_time + attributes = { + "written_on(4i)" => "16", "written_on(5i)" => "24" + } + topic = Topic.find(1) + topic.attributes = attributes + assert_equal Time.local(Date.today.year, Date.today.month, Date.today.day, 16, 24), topic.written_on + end + + def test_multiparameter_attributes_on_time_with_ignore_date_small_time + attributes = { + "written_on(4i)" => "16", "written_on(5i)" => "12", "written_on(6i)" => "02" + } + topic = Topic.find(1) + topic.attributes = attributes + assert_equal Time.local(Date.today.year, Date.today.month, Date.today.day, 16, 12, 02), topic.written_on + end + def test_multiparameter_assignment_of_aggregation customer = Customer.new address = Address.new("The Street", "The City", "The Country") -- 1.7.1