class RedirectTest
Public Instance Methods
test_module_redirect()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 209 def test_module_redirect get :module_redirect assert_response :redirect assert_redirected_to "http://test.host/module_test/module_redirect/hello_world" end
test_module_redirect_using_options()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 215 def test_module_redirect_using_options get :module_redirect assert_response :redirect assert_redirected_to controller: "module_test/module_redirect", action: "hello_world" end
test_redirect_back()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 245 def test_redirect_back referer = "http://www.example.com/coming/from" @request.env["HTTP_REFERER"] = referer get :redirect_back_with_status assert_response 307 assert_equal referer, redirect_to_url end
test_redirect_back_with_no_referer()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 255 def test_redirect_back_with_no_referer get :redirect_back_with_status assert_response 307 assert_equal "http://test.host/things/stuff", redirect_to_url end
test_redirect_to_nil()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 282 def test_redirect_to_nil error = assert_raise(ActionController::ActionControllerError) do get :redirect_to_nil end assert_equal "Cannot redirect to nil!", error.message end
test_redirect_to_params()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 289 def test_redirect_to_params error = assert_raise(ActionController::UnfilteredParameters) do get :redirect_to_params end assert_equal "unable to convert unpermitted parameters to hash", error.message end
test_redirect_to_record()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 262 def test_redirect_to_record with_routing do |set| set.draw do resources :workshops ActiveSupport::Deprecation.silence do get ":controller/:action" end end get :redirect_to_existing_record assert_equal "http://test.host/workshops/5", redirect_to_url assert_redirected_to Workshop.new(5) get :redirect_to_new_record assert_equal "http://test.host/workshops", redirect_to_url assert_redirected_to Workshop.new(nil) end end
test_redirect_to_url()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 221 def test_redirect_to_url get :redirect_to_url assert_response :redirect assert_redirected_to "http://www.rubyonquails.org/" end
test_redirect_to_url_with_complex_scheme()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 233 def test_redirect_to_url_with_complex_scheme get :redirect_to_url_with_complex_scheme assert_response :redirect assert_equal "x-test+scheme.complex:redirect", redirect_to_url end
test_redirect_to_url_with_network_path_reference()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 239 def test_redirect_to_url_with_network_path_reference get :redirect_to_url_with_network_path_reference assert_response :redirect assert_equal "//www.rubyonquails.org/", redirect_to_url end
test_redirect_to_url_with_unescaped_query_string()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 227 def test_redirect_to_url_with_unescaped_query_string get :redirect_to_url_with_unescaped_query_string assert_response :redirect assert_redirected_to "http://example.com/query?status=new" end
test_redirect_to_with_block()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 296 def test_redirect_to_with_block get :redirect_to_with_block assert_response :redirect assert_redirected_to "http://www.rubyonquails.org/" end
test_redirect_to_with_block_and_accepted_options()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 308 def test_redirect_to_with_block_and_accepted_options with_routing do |set| set.draw do ActiveSupport::Deprecation.silence do get ":controller/:action" end end get :redirect_to_with_block_and_options assert_response :redirect assert_redirected_to "http://test.host/redirect/hello_world" end end
test_redirect_to_with_block_and_assigns()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 302 def test_redirect_to_with_block_and_assigns get :redirect_to_with_block_and_assigns assert_response :redirect assert_redirected_to "http://www.rubyonquails.org/" end
test_redirect_with_header_break()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 143 def test_redirect_with_header_break get :redirect_with_header_break assert_response :redirect assert_equal "http://test.host/lolwat", redirect_to_url end
test_redirect_with_no_status()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 155 def test_redirect_with_no_status get :simple_redirect assert_response 302 assert_equal "http://test.host/redirect/hello_world", redirect_to_url end
test_redirect_with_null_bytes()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 149 def test_redirect_with_null_bytes get :redirect_with_null_bytes assert_response :redirect assert_equal "http://test.host/lolwat", redirect_to_url end
test_redirect_with_protocol()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 173 def test_redirect_with_protocol get :redirect_with_protocol assert_response 302 assert_equal "https://test.host/redirect/hello_world", redirect_to_url end
test_redirect_with_status()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 161 def test_redirect_with_status get :redirect_with_status assert_response 301 assert_equal "http://test.host/redirect/hello_world", redirect_to_url end
test_redirect_with_status_hash()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 167 def test_redirect_with_status_hash get :redirect_with_status_hash assert_response 301 assert_equal "http://test.host/redirect/hello_world", redirect_to_url end
test_relative_url_redirect_with_status()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 191 def test_relative_url_redirect_with_status get :relative_url_redirect_with_status assert_response 302 assert_equal "http://test.host/things/stuff", redirect_to_url end
test_relative_url_redirect_with_status_hash()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 197 def test_relative_url_redirect_with_status_hash get :relative_url_redirect_with_status_hash assert_response 301 assert_equal "http://test.host/things/stuff", redirect_to_url end
test_simple_redirect()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 137 def test_simple_redirect get :simple_redirect assert_response :redirect assert_equal "http://test.host/redirect/hello_world", redirect_to_url end
test_simple_redirect_using_options()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 203 def test_simple_redirect_using_options get :host_redirect assert_response :redirect assert_redirected_to action: "other_host", only_path: false, host: "other.test.host" end
test_url_redirect_with_status()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 179 def test_url_redirect_with_status get :url_redirect_with_status assert_response 301 assert_equal "http://www.example.com", redirect_to_url end
test_url_redirect_with_status_hash()
click to toggle source
# File actionpack/test/controller/redirect_test.rb, line 185 def test_url_redirect_with_status_hash get :url_redirect_with_status_hash assert_response 301 assert_equal "http://www.example.com", redirect_to_url end