From 19c763f7831e08606e6b4fa516f5ad3b00c6428f Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 28 Feb 2011 15:47:03 -0800 Subject: [PATCH 01/26] reduce two method calls per request, 1 to method_missing and one to send --- railties/lib/rails/commands/server.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index c3927b6613..e447209242 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -42,6 +42,10 @@ module Rails set_environment end + def app + @app ||= super.instance + end + def opt_parser Options.new end From 54fdd33f33e6d42cf034a19cf64c6c52426de872 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 28 Feb 2011 16:30:14 -0800 Subject: [PATCH 02/26] use a subclass of AS::TZ for testing html output --- actionpack/test/template/date_helper_test.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index b4eb3f76e1..aca2fef170 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -1882,10 +1882,17 @@ class DateHelperTest < ActionView::TestCase end def test_datetime_select_defaults_to_time_zone_now_when_config_time_zone_is_set - time = stub(:year => 2004, :month => 6, :day => 15, :hour => 16, :min => 35, :sec => 0) - time_zone = mock() - time_zone.expects(:now).returns time - Time.zone = time_zone + # The love zone is UTC+0 + mytz = Class.new(ActiveSupport::TimeZone) { + attr_accessor :now + }.create('tenderlove', 0) + + now = Time.mktime(2004, 6, 15, 16, 35, 0) + mytz.now = now + Time.zone = mytz + + assert_equal mytz, Time.zone + @post = Post.new expected = %{