From 6545a68264682e8d0a0ee0e913fa98d92fef9428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 24 Jan 2010 15:08:06 +0100 Subject: Fix failing tests after merge. --- actionmailer/lib/action_mailer/mail_helper.rb | 2 +- actionpack/lib/action_controller/metal/helpers.rb | 1 + actionpack/test/abstract/helper_test.rb | 2 +- actionpack/test/controller/helper_test.rb | 4 ++-- actionpack/test/fixtures/helpers/fun/games_helper.rb | 6 ++++-- actionpack/test/fixtures/helpers/fun/pdf_helper.rb | 6 ++++-- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb index 701dc34431..df71330fd5 100644 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ b/actionmailer/lib/action_mailer/mail_helper.rb @@ -18,7 +18,7 @@ module ActionMailer # Access the mailer instance. def mailer #:nodoc: - @controller + @_controller end end end diff --git a/actionpack/lib/action_controller/metal/helpers.rb b/actionpack/lib/action_controller/metal/helpers.rb index 757ce3c319..0e3db86861 100644 --- a/actionpack/lib/action_controller/metal/helpers.rb +++ b/actionpack/lib/action_controller/metal/helpers.rb @@ -111,6 +111,7 @@ module ActionController extract = /^#{Regexp.quote(path)}\/?(.*)_helper.rb$/ helpers += Dir["#{path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1') } end + helpers.sort! helpers.uniq! helpers end diff --git a/actionpack/test/abstract/helper_test.rb b/actionpack/test/abstract/helper_test.rb index ade29140ba..0cdf5c2298 100644 --- a/actionpack/test/abstract/helper_test.rb +++ b/actionpack/test/abstract/helper_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -ActionController::Base.helpers_dir = File.dirname(__FILE__) + '/../fixtures/helpers' +ActionController::Base.helpers_path = [File.dirname(__FILE__) + '/../fixtures/helpers'] module AbstractController module Testing diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb index 9030e562bb..fe0961e575 100644 --- a/actionpack/test/controller/helper_test.rb +++ b/actionpack/test/controller/helper_test.rb @@ -1,7 +1,7 @@ require 'abstract_unit' require 'active_support/core_ext/kernel/reporting' -ActionController::Base.helpers_dir = File.dirname(__FILE__) + '/../fixtures/helpers' +ActionController::Base.helpers_path = [File.dirname(__FILE__) + '/../fixtures/helpers'] module Fun class GamesController < ActionController::Base @@ -106,7 +106,7 @@ class HelperTest < Test::Unit::TestCase end def test_all_helpers_with_alternate_helper_dir - @controller_class.helpers_dir = File.dirname(__FILE__) + '/../fixtures/alternate_helpers' + @controller_class.helpers_path = [File.dirname(__FILE__) + '/../fixtures/alternate_helpers'] # Reload helpers @controller_class._helpers = Module.new diff --git a/actionpack/test/fixtures/helpers/fun/games_helper.rb b/actionpack/test/fixtures/helpers/fun/games_helper.rb index bf60d9db0c..3b7adce086 100644 --- a/actionpack/test/fixtures/helpers/fun/games_helper.rb +++ b/actionpack/test/fixtures/helpers/fun/games_helper.rb @@ -1,3 +1,5 @@ -module Fun::GamesHelper - def stratego() "Iz guuut!" end +module Fun + module GamesHelper + def stratego() "Iz guuut!" end + end end \ No newline at end of file diff --git a/actionpack/test/fixtures/helpers/fun/pdf_helper.rb b/actionpack/test/fixtures/helpers/fun/pdf_helper.rb index c4aea5a3f3..0171be8500 100644 --- a/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +++ b/actionpack/test/fixtures/helpers/fun/pdf_helper.rb @@ -1,3 +1,5 @@ -module Fun::PdfHelper - def foobar() 'baz' end +module Fun + module PdfHelper + def foobar() 'baz' end + end end -- cgit v1.2.3