diff --git a/Gemfile b/Gemfile index 243e2ff2..d3192457 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/lib/devise/rails/routes.rb b/lib/devise/rails/routes.rb index 4e630cd7..f734cf7e 100644 --- a/lib/devise/rails/routes.rb +++ b/lib/devise/rails/routes.rb @@ -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 diff --git a/test/integration/database_authenticatable_test.rb b/test/integration/database_authenticatable_test.rb index 918ef2b7..aa0da0e2 100644 --- a/test/integration/database_authenticatable_test.rb +++ b/test/integration/database_authenticatable_test.rb @@ -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 diff --git a/test/integration/rememberable_test.rb b/test/integration/rememberable_test.rb index a8d8947c..a7850516 100644 --- a/test/integration/rememberable_test.rb +++ b/test/integration/rememberable_test.rb @@ -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 diff --git a/test/rails_app/config/application.rb b/test/rails_app/config/application.rb index 94d8c069..cc9ea859 100644 --- a/test/rails_app/config/application.rb +++ b/test/rails_app/config/application.rb @@ -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 diff --git a/test/rails_app/config/environments/test.rb b/test/rails_app/config/environments/test.rb index bff97e8a..8aff4f7f 100644 --- a/test/rails_app/config/environments/test.rb +++ b/test/rails_app/config/environments/test.rb @@ -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 diff --git a/test/rails_app/config/initializers/secret_token.rb b/test/rails_app/config/initializers/secret_token.rb new file mode 100644 index 00000000..aba22be6 --- /dev/null +++ b/test/rails_app/config/initializers/secret_token.rb @@ -0,0 +1,2 @@ +Rails.application.config.cookie_secret = 'ea942c41850d502f2c8283e26bdc57829f471bb18224ddff0a192c4f32cdf6cb5aa0d82b3a7a7adbeb640c4b06f3aa1cd5f098162d8240f669b39d6b49680571' +Rails.application.config.session_store :cookie_store, :key => "_my_app" \ No newline at end of file