mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fix failure_app failing test.
This commit is contained in:
parent
58d61c290a
commit
22136a708b
4 changed files with 5 additions and 12 deletions
|
@ -100,10 +100,6 @@ module Devise
|
||||||
"/#{@path_prefix}/#{@path}".squeeze("/")
|
"/#{@path_prefix}/#{@path}".squeeze("/")
|
||||||
end
|
end
|
||||||
|
|
||||||
def failure_app
|
|
||||||
Devise::FailureApp
|
|
||||||
end
|
|
||||||
|
|
||||||
# Create magic predicates for verifying what module is activated by this map.
|
# Create magic predicates for verifying what module is activated by this map.
|
||||||
# Example:
|
# Example:
|
||||||
#
|
#
|
||||||
|
|
|
@ -202,9 +202,7 @@ class AuthenticationSanityTest < ActionController::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'scope uses custom failure app' do
|
test 'scope uses custom failure app' do
|
||||||
app = lambda { |env| [404, {"Content-Type" => "text/plain"}, ["Oops, not found"]] }
|
put "/en/accounts/management"
|
||||||
Devise.mappings[:admin].expects(:failure_app).returns(app)
|
|
||||||
get admins_path
|
|
||||||
assert_equal "Oops, not found", response.body
|
assert_equal "Oops, not found", response.body
|
||||||
assert_equal 404, response.status
|
assert_equal 404, response.status
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,6 @@ RailsApp::Application.configure do
|
||||||
|
|
||||||
# Show full error reports and disable caching
|
# Show full error reports and disable caching
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_view.debug_rjs = true
|
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|
||||||
# Don't care if the mailer can't send
|
# Don't care if the mailer can't send
|
||||||
|
|
|
@ -71,7 +71,7 @@ Rails.application.routes.draw do
|
||||||
:password => "secret", :confirmation => "verification",
|
:password => "secret", :confirmation => "verification",
|
||||||
:unlock => "unblock", :sign_up => "register",
|
:unlock => "unblock", :sign_up => "register",
|
||||||
:registration => "management", :cancel => "giveup"
|
:registration => "management", :cancel => "giveup"
|
||||||
}
|
}, :failure_app => lambda { |env| [404, {"Content-Type" => "text/plain"}, ["Oops, not found"]] }
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :sign_out_via, :module => "devise" do
|
namespace :sign_out_via, :module => "devise" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue