mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
test i18n against a routed app
This commit is contained in:
parent
1e7f28c985
commit
e0c6b35dac
1 changed files with 16 additions and 1 deletions
|
@ -28,8 +28,23 @@ class ActionMailerI18nWithControllerTest < ActionDispatch::IntegrationTest
|
|||
get ':controller(/:action(/:id))'
|
||||
end
|
||||
|
||||
class RoutedRackApp
|
||||
attr_reader :routes
|
||||
|
||||
def initialize(routes, &blk)
|
||||
@routes = routes
|
||||
@stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes)
|
||||
end
|
||||
|
||||
def call(env)
|
||||
@stack.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
APP = RoutedRackApp.new(Routes)
|
||||
|
||||
def app
|
||||
Routes
|
||||
APP
|
||||
end
|
||||
|
||||
teardown do
|
||||
|
|
Loading…
Reference in a new issue