Namespace
Methods
- S
- T
Instance Public methods
setup()
Link
# File actionpack/test/controller/url_rewriter_test.rb, line 18 def setup @request = ActionController::TestRequest.new @params = {} @rewriter = Rewriter.new(@request) #.new(@request, @params) @routes = ActionDispatch::Routing::RouteSet.new.tap do |r| r.draw do match ':controller(/:action(/:id))' end end end
test_anchor()
Link
test_anchor_should_be_uri_escaped()
Link
# File actionpack/test/controller/url_rewriter_test.rb, line 73 def test_anchor_should_be_uri_escaped assert_equal( 'http://test.host/c/a/i#anc/hor', @rewriter.rewrite(@routes, :controller => 'c', :action => 'a', :id => 'i', :anchor => Struct.new(:to_param).new('anc/hor')) ) end
test_anchor_should_call_to_param()
Link
# File actionpack/test/controller/url_rewriter_test.rb, line 66 def test_anchor_should_call_to_param assert_equal( 'http://test.host/c/a/i#anchor', @rewriter.rewrite(@routes, :controller => 'c', :action => 'a', :id => 'i', :anchor => Struct.new(:to_param).new('anchor')) ) end
test_port()
Link
test_protocol_with_and_without_separator()
Link
# File actionpack/test/controller/url_rewriter_test.rb, line 35 def test_protocol_with_and_without_separator assert_equal('https://test.host/c/a/i', @rewriter.rewrite(@routes, :protocol => 'https', :controller => 'c', :action => 'a', :id => 'i') ) assert_equal('https://test.host/c/a/i', @rewriter.rewrite(@routes, :protocol => 'https://', :controller => 'c', :action => 'a', :id => 'i') ) end
test_trailing_slash()
Link
# File actionpack/test/controller/url_rewriter_test.rb, line 80 def test_trailing_slash options = {:controller => 'foo', :action => 'bar', :id => '3', :only_path => true} assert_equal '/foo/bar/3', @rewriter.rewrite(@routes, options) assert_equal '/foo/bar/3?query=string', @rewriter.rewrite(@routes, options.merge({:query => 'string'})) options.update({:trailing_slash => true}) assert_equal '/foo/bar/3/', @rewriter.rewrite(@routes, options) options.update({:query => 'string'}) assert_equal '/foo/bar/3/?query=string', @rewriter.rewrite(@routes, options) end
test_user_name_and_password()
Link
test_user_name_and_password_with_escape_codes()
Link
# File actionpack/test/controller/url_rewriter_test.rb, line 52 def test_user_name_and_password_with_escape_codes assert_equal( 'http://openid.aol.com%2Fnextangler:one+two%3F@test.host/c/a/i', @rewriter.rewrite(@routes, :user => "openid.aol.com/nextangler", :password => "one two?", :controller => 'c', :action => 'a', :id => 'i') ) end