Try to fix the build for rails 3.1
This commit is contained in:
parent
1698f0f57c
commit
454a5ad1ec
|
@ -88,7 +88,9 @@ module Devise
|
|||
opts = {}
|
||||
route = :"new_#{scope}_session_path"
|
||||
opts[:format] = request_format unless skip_format?
|
||||
opts[:script_name] = Rails.application.config.relative_url_root
|
||||
|
||||
config = Rails.application.config
|
||||
opts[:script_name] = (config.relative_url_root if config.respond_to?(:relative_url_root))
|
||||
|
||||
context = send(Devise.available_router_name)
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ class FailureTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
if Rails.application.config.respond_to?(:relative_url_root)
|
||||
test 'returns to the default redirect location considering the relative url root' do
|
||||
swap Rails.application.config, :relative_url_root => "/sample" do
|
||||
call_failure
|
||||
|
@ -58,6 +59,7 @@ class FailureTest < ActiveSupport::TestCase
|
|||
assert_equal 'http://test.host/sample/users/sign_in', @response.second['Location']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test 'uses the proxy failure message as symbol' do
|
||||
call_failure('warden' => OpenStruct.new(:message => :invalid))
|
||||
|
|
Loading…
Reference in New Issue