aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb4
-rw-r--r--actionpack/test/template/translation_helper_test.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index a6b32e0152..b48fc6edc5 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -92,9 +92,9 @@ module ActionDispatch
controller, action = to.split('#')
{ :controller => controller, :action => action }
when Symbol
- { :controller => default_controller, :action => to.to_s }
+ { :action => to.to_s }.merge(default_controller ? { :controller => default_controller } : {})
else
- { :controller => default_controller }
+ default_controller ? { :controller => default_controller } : {}
end
if defaults[:controller].blank? && segment_keys.exclude?("controller")
diff --git a/actionpack/test/template/translation_helper_test.rb b/actionpack/test/template/translation_helper_test.rb
index a20f3c394c..d67d2c7911 100644
--- a/actionpack/test/template/translation_helper_test.rb
+++ b/actionpack/test/template/translation_helper_test.rb
@@ -9,7 +9,7 @@ class TranslationHelperTest < Test::Unit::TestCase
end
def test_delegates_to_i18n_setting_the_raise_option
- I18n.expects(:translate).with(:foo, :locale => 'en', :raise => true)
+ I18n.expects(:translate).with(:foo, :locale => 'en', :raise => true).returns("")
translate :foo, :locale => 'en'
end
@@ -26,7 +26,7 @@ class TranslationHelperTest < Test::Unit::TestCase
def test_scoping_by_partial
expects(:template).returns(stub(:path_without_format_and_extension => "people/index"))
- I18n.expects(:translate).with("people.index.foo", :locale => 'en', :raise => true)
+ I18n.expects(:translate).with("people.index.foo", :locale => 'en', :raise => true).returns("")
translate ".foo", :locale => 'en'
end
end