1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Compatibility with Rails beta 3.

This commit is contained in:
José Valim 2010-04-05 11:46:26 +02:00
parent f9cbd3c457
commit 1591294b7a
7 changed files with 18 additions and 18 deletions

View file

@ -1,7 +1,7 @@
source "http://gemcutter.org"
# Need to install Rails from source
gem "rails", "3.0.0.beta2"
gem "rails", "3.0.0.beta3"
gem "warden", "0.10.3"
gem "sqlite3-ruby", :require => "sqlite3"
gem "webrat", "0.7"

View file

@ -119,25 +119,25 @@ module ActionDispatch::Routing
def devise_password(mapping, controllers)
scope mapping.path, :name_prefix => mapping.name do
resource :password, :only => [:new, :create, :edit, :update], :as => mapping.path_names[:password], :controller => controllers[:passwords]
resource :password, :only => [:new, :create, :edit, :update], :path => mapping.path_names[:password], :controller => controllers[:passwords]
end
end
def devise_confirmation(mapping, controllers)
scope mapping.path, :name_prefix => mapping.name do
resource :confirmation, :only => [:new, :create, :show], :as => mapping.path_names[:confirmation], :controller => controllers[:confirmations]
resource :confirmation, :only => [:new, :create, :show], :path => mapping.path_names[:confirmation], :controller => controllers[:confirmations]
end
end
def devise_unlock(mapping, controllers)
scope mapping.path, :name_prefix => mapping.name do
resource :unlock, :only => [:new, :create, :show], :as => mapping.path_names[:unlock], :controller => controllers[:unlocks]
resource :unlock, :only => [:new, :create, :show], :path => mapping.path_names[:unlock], :controller => controllers[:unlocks]
end
end
def devise_registration(mapping, controllers)
scope mapping.path[1..-1], :name_prefix => "#{mapping.name}_registration" do
resource :registration, :only => [:new, :create, :edit, :update, :destroy], :as => "",
scope mapping.path[1..-1], :name_prefix => mapping.name do
resource :registration, :only => [:new, :create, :edit, :update, :destroy], :path => "",
:path_names => { :new => mapping.path_names[:sign_up] }, :controller => controllers[:registrations]
end
end

View file

@ -284,15 +284,15 @@ class AuthenticationTest < ActionController::IntegrationTest
end
# Access
test 'render 404 on roles without permission' do
get '/admin_area/password/new', {}, "action_dispatch.show_exceptions" => true
assert_response :not_found
assert_not_contain 'Send me reset password instructions'
test 'render 404 on roles without routes' do
assert_raise ActionController::RoutingError do
get '/admin_area/password/new'
end
end
test 'render 404 on roles without mapping' do
get '/sign_in', {}, "action_dispatch.show_exceptions" => true
assert_response :not_found
assert_not_contain 'Sign in'
assert_raise AbstractController::ActionNotFound do
get '/sign_in'
end
end
end

View file

@ -12,7 +12,7 @@ class RememberMeTest < ActionController::IntegrationTest
end
def generate_signed_cookie(raw_cookie)
request = ActionDispatch::Request.new({})
request = ActionDispatch::TestRequest.new
request.cookie_jar.signed['raw_cookie'] = raw_cookie
request.cookie_jar['raw_cookie']
end

View file

@ -29,9 +29,5 @@ module RailsApp
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters << :password
# Cookie settings
config.cookie_secret = 'ea942c41850d502f2c8283e26bdc57829f471bb18224ddff0a192c4f32cdf6cb5aa0d82b3a7a7adbeb640c4b06f3aa1cd5f098162d8240f669b39d6b49680571'
config.session_store :cookie_store, :key => "_my_app"
end
end

View file

@ -26,4 +26,6 @@ RailsApp::Application.configure do
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
config.action_dispatch.show_exceptions = false
end

View file

@ -0,0 +1,2 @@
Rails.application.config.cookie_secret = 'ea942c41850d502f2c8283e26bdc57829f471bb18224ddff0a192c4f32cdf6cb5aa0d82b3a7a7adbeb640c4b06f3aa1cd5f098162d8240f669b39d6b49680571'
Rails.application.config.session_store :cookie_store, :key => "_my_app"