diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2014-12-03 14:47:02 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2014-12-03 14:47:02 -0500 |
commit | a83ad97f473a684417dc22fd7854ee5526e1b8ca (patch) | |
tree | cb3234d6690766f548d284bf047bf2349c88d0e9 /railties | |
parent | b612df9a25db1b7e509c6410b3f4fbd4a87144c4 (diff) | |
parent | 05a6fafdd5559ff53897afb8a2aff353e5ac8805 (diff) | |
download | rails-a83ad97f473a684417dc22fd7854ee5526e1b8ca.tar.gz rails-a83ad97f473a684417dc22fd7854ee5526e1b8ca.tar.bz2 rails-a83ad97f473a684417dc22fd7854ee5526e1b8ca.zip |
Merge pull request #17891 from prathamesh-sonpatki/remove-mocha-from-info-controller-tests
Removed use of mocha in the info_controller tests
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/rails_info_controller_test.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/railties/test/rails_info_controller_test.rb b/railties/test/rails_info_controller_test.rb index 8d61af4972..d336a2e6c0 100644 --- a/railties/test/rails_info_controller_test.rb +++ b/railties/test/rails_info_controller_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'mocha/setup' # FIXME: stop using mocha module ActionController class Base @@ -15,26 +14,26 @@ class InfoControllerTest < ActionController::TestCase get '/rails/info/properties' => "rails/info#properties" get '/rails/info/routes' => "rails/info#routes" end - @controller.stubs(:local_request? => true) @routes = Rails.application.routes Rails::InfoController.send(:include, @routes.url_helpers) + + @request.env["REMOTE_ADDR"] = "127.0.0.1" end test "info controller does not allow remote requests" do - @controller.stubs(local_request?: false) + @request.env["REMOTE_ADDR"] = "example.org" get :properties assert_response :forbidden end test "info controller renders an error message when request was forbidden" do - @controller.stubs(local_request?: false) + @request.env["REMOTE_ADDR"] = "example.org" get :properties assert_select 'p' end test "info controller allows requests when all requests are considered local" do - @controller.stubs(local_request?: true) get :properties assert_response :success end |