diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-13 17:34:20 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-13 17:35:52 -0300 |
commit | 919888503d481c3bd21a33acd3cd1018fc48f500 (patch) | |
tree | bfea4bc408e3ab968556f5ce20a7464206e14e9d /railties/test | |
parent | b9eec677c4ca28203124a9b5b160a57ca13b95f1 (diff) | |
download | rails-919888503d481c3bd21a33acd3cd1018fc48f500.tar.gz rails-919888503d481c3bd21a33acd3cd1018fc48f500.tar.bz2 rails-919888503d481c3bd21a33acd3cd1018fc48f500.zip |
Moves local_request? to require.local?
[#5361 state:committed]
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/rails_info_controller_test.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/test/rails_info_controller_test.rb b/railties/test/rails_info_controller_test.rb index 687c2d1568..9d194f41a6 100644 --- a/railties/test/rails_info_controller_test.rb +++ b/railties/test/rails_info_controller_test.rb @@ -14,26 +14,28 @@ class InfoControllerTest < ActionController::TestCase Rails.application.routes.draw do match '/rails/info/properties' => "rails/info#properties" end - @controller.stubs(:consider_all_requests_local? => false, :local_request? => true) + @request.stubs(:local? => true) + @controller.stubs(:consider_all_requests_local? => false) @routes = Rails.application.routes Rails::InfoController.send(:include, @routes.url_helpers) end test "info controller does not allow remote requests" do - @controller.stubs(:consider_all_requests_local? => false, :local_request? => false) + @request.stubs(:local? => false) get :properties assert_response :forbidden end test "info controller renders an error message when request was forbidden" do - @controller.stubs(:consider_all_requests_local? => false, :local_request? => false) + @request.stubs(:local? => false) get :properties assert_select 'p' end test "info controller allows requests when all requests are considered local" do - @controller.stubs(:consider_all_requests_local? => true, :local_request? => false) + @request.stubs(:local? => false) + @controller.stubs(:consider_all_requests_local? => true) get :properties assert_response :success end |