mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Merge pull request #1661 from mreinsch/fix_subdomain_routing
fix for when using :host in routes
This commit is contained in:
@@ -58,6 +58,10 @@ Rails.application.routes.draw do
|
||||
# Other routes for routing_test.rb
|
||||
devise_for :reader, :class_name => "User", :only => :passwords
|
||||
|
||||
scope :host => "sub.example.com" do
|
||||
devise_for :sub_admin, :class_name => "Admin"
|
||||
end
|
||||
|
||||
namespace :publisher, :path_names => { :sign_in => "i_dont_care", :sign_out => "get_out" } do
|
||||
devise_for :accounts, :class_name => "Admin", :path_names => { :sign_in => "get_in" }
|
||||
end
|
||||
|
||||
@@ -128,6 +128,10 @@ class CustomizedRoutingTest < ActionController::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
test 'subdomain admin' do
|
||||
assert_recognizes({"host"=>"sub.example.com", :controller => 'devise/sessions', :action => 'new'}, {:host => "sub.example.com", :path => '/sub_admin/sign_in', :method => :get})
|
||||
end
|
||||
|
||||
test 'does only map reader password' do
|
||||
assert_raise ActionController::RoutingError do
|
||||
assert_recognizes({:controller => 'devise/sessions', :action => 'new'}, 'reader/sessions/new')
|
||||
|
||||
Reference in New Issue
Block a user