Use scope instead of constraints to define routes.

It works the same with rails 3 and rails 4.
This commit is contained in:
Kamil Giszczak
2014-04-04 16:07:37 +02:00
parent a38f2f96b5
commit 9cada8d2d4
2 changed files with 4 additions and 2 deletions

View File

@@ -12,7 +12,9 @@ class FailureTest < ActiveSupport::TestCase
routes = ActionDispatch::Routing::RouteSet.new
routes.draw do
root to: 'foo#bar', constraints: { subdomain: 'sub' }
scope subdomain: 'sub' do
root to: 'foo#bar'
end
end
include routes.url_helpers