Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset PATH_INFO between ActionController tests #22402

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add test case
  • Loading branch information
mastahyeti committed Nov 25, 2015
commit 0456caff3a4a18c75a7983a847e29e4a7b04ec0d
16 changes: 16 additions & 0 deletions actionpack/test/controller/test_case_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ def test_with_body
render html: '<body class="foo"></body>'.html_safe
end

def path_one
render plain: request.fullpath
end

def path_two
render plain: request.fullpath
end

private

def generate_url(opts)
Expand Down Expand Up @@ -966,6 +974,14 @@ def test_redirect_url_only_cares_about_location_header
assert_redirected_to 'created resource'
end
end

def test_request_path_correct
get :path_one
assert_equal "/test_case_test/test/path_one", @response.body

get :path_two
assert_equal "/test_case_test/test/path_two", @response.body
end
end

class ResponseDefaultHeadersTest < ActionController::TestCase
Expand Down