From 22136a708ba3d7a61f8d794e651ffa6e650bb353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 7 Nov 2011 21:38:31 -0200 Subject: [PATCH] Fix failure_app failing test. --- lib/devise/mapping.rb | 4 ---- test/integration/authenticatable_test.rb | 4 +--- test/rails_app/config/environments/development.rb | 1 - test/rails_app/config/routes.rb | 8 ++++---- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/devise/mapping.rb b/lib/devise/mapping.rb index 6f8c6516..3fa69f25 100644 --- a/lib/devise/mapping.rb +++ b/lib/devise/mapping.rb @@ -100,10 +100,6 @@ module Devise "/#{@path_prefix}/#{@path}".squeeze("/") end - def failure_app - Devise::FailureApp - end - # Create magic predicates for verifying what module is activated by this map. # Example: # diff --git a/test/integration/authenticatable_test.rb b/test/integration/authenticatable_test.rb index de8b16f4..b471674f 100644 --- a/test/integration/authenticatable_test.rb +++ b/test/integration/authenticatable_test.rb @@ -202,9 +202,7 @@ class AuthenticationSanityTest < ActionController::IntegrationTest end test 'scope uses custom failure app' do - app = lambda { |env| [404, {"Content-Type" => "text/plain"}, ["Oops, not found"]] } - Devise.mappings[:admin].expects(:failure_app).returns(app) - get admins_path + put "/en/accounts/management" assert_equal "Oops, not found", response.body assert_equal 404, response.status end diff --git a/test/rails_app/config/environments/development.rb b/test/rails_app/config/environments/development.rb index b210e734..bc251f75 100644 --- a/test/rails_app/config/environments/development.rb +++ b/test/rails_app/config/environments/development.rb @@ -11,7 +11,6 @@ RailsApp::Application.configure do # Show full error reports and disable caching config.consider_all_requests_local = true - config.action_view.debug_rjs = true config.action_controller.perform_caching = false # Don't care if the mailer can't send diff --git a/test/rails_app/config/routes.rb b/test/rails_app/config/routes.rb index 296e9afe..74994493 100644 --- a/test/rails_app/config/routes.rb +++ b/test/rails_app/config/routes.rb @@ -46,17 +46,17 @@ Rails.application.routes.draw do # Routes for constraints testing devise_for :headquarters_admin, :class_name => "Admin", :path => "headquarters", :constraints => {:host => /192\.168\.1\.\d\d\d/} - + constraints(:host => /192\.168\.1\.\d\d\d/) do devise_for :homebase_admin, :class_name => "Admin", :path => "homebase" end devise_for :skip_admin, :class_name => "Admin", :skip => :all - + # Routes for format=false testing devise_for :htmlonly_admin, :class_name => "Admin", :skip => [:confirmations, :unlocks], :path => "htmlonly_admin", :format => false, :skip_helpers => [:confirmations, :unlocks] devise_for :htmlonly_users, :class_name => "User", :only => [:confirmations, :unlocks], :path => "htmlonly_users", :format => false, :skip_helpers => true - + # Other routes for routing_test.rb devise_for :reader, :class_name => "User", :only => :passwords @@ -71,7 +71,7 @@ Rails.application.routes.draw do :password => "secret", :confirmation => "verification", :unlock => "unblock", :sign_up => "register", :registration => "management", :cancel => "giveup" - } + }, :failure_app => lambda { |env| [404, {"Content-Type" => "text/plain"}, ["Oops, not found"]] } end namespace :sign_out_via, :module => "devise" do