aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract/translation_test.rb4
-rw-r--r--actionpack/test/dispatch/routing/inspector_test.rb8
2 files changed, 10 insertions, 2 deletions
diff --git a/actionpack/test/abstract/translation_test.rb b/actionpack/test/abstract/translation_test.rb
index 35e7fd69b5..4fdc480b43 100644
--- a/actionpack/test/abstract/translation_test.rb
+++ b/actionpack/test/abstract/translation_test.rb
@@ -29,13 +29,13 @@ module AbstractController
def test_lazy_lookup
expected = 'bar'
- @controller.stubs(:action_name => :index)
+ @controller.stubs(action_name: :index)
I18n.stubs(:translate).with('abstract_controller.testing.translation.index.foo').returns(expected)
assert_equal expected, @controller.t('.foo')
end
def test_default_translation
- key, expected = 'one.two' 'bar'
+ key, expected = 'one.two', 'bar'
I18n.stubs(:translate).with(key).returns(expected)
assert_equal expected, @controller.t(key)
end
diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb
index c7dcb5a683..55221f87c4 100644
--- a/actionpack/test/dispatch/routing/inspector_test.rb
+++ b/actionpack/test/dispatch/routing/inspector_test.rb
@@ -21,6 +21,14 @@ module ActionDispatch
inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, options[:filter]).split("\n")
end
+ def test_json_regexp_converter
+ @set.draw do
+ get '/cart', :to => 'cart#show'
+ end
+ route = ActionDispatch::Routing::RouteWrapper.new(@set.routes.first)
+ assert_equal "^\\/cart(?:\\.([^\\/.?]+))?$", route.json_regexp
+ end
+
def test_displaying_routes_for_engines
engine = Class.new(Rails::Engine) do
def self.inspect