mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Try to fix the build for rails 3.1
This commit is contained in:
@@ -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,11 +51,13 @@ class FailureTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
test 'returns to the default redirect location considering the relative url root' do
|
||||
swap Rails.application.config, :relative_url_root => "/sample" do
|
||||
call_failure
|
||||
assert_equal 302, @response.first
|
||||
assert_equal 'http://test.host/sample/users/sign_in', @response.second['Location']
|
||||
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
|
||||
assert_equal 302, @response.first
|
||||
assert_equal 'http://test.host/sample/users/sign_in', @response.second['Location']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user