Skip to content
This repository
tree: 4d872d11b4
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 28 lines (23 sloc) 0.729 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
require "abstract_unit"

module ApplicationTests
  class BuildOriginalPathTest < Test::Unit::TestCase
    def test_include_original_PATH_info_in_ORIGINAL_FULLPATH
      env = { 'PATH_INFO' => '/foo/' }
      assert_equal "/foo/", Rails.application.send(:build_original_fullpath, env)
    end

    def test_include_SCRIPT_NAME
      env = {
        'SCRIPT_NAME' => '/foo',
        'PATH_INFO' => '/bar'
      }

      assert_equal "/foo/bar", Rails.application.send(:build_original_fullpath, env)
    end

    def test_include_QUERY_STRING
      env = {
        'PATH_INFO' => '/foo',
        'QUERY_STRING' => 'bar',
      }
      assert_equal "/foo?bar", Rails.application.send(:build_original_fullpath, env)
    end
  end
end
Something went wrong with that request. Please try again.