diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-05 06:13:14 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-05 06:13:14 -0700 |
commit | f4a690dae7eec4ab8c129a0318fadc179e055d80 (patch) | |
tree | a58632394cbbdd769410c0b7759f5225c928582a /actionpack/test | |
parent | c255e0eed5849ed7866d3c5999a4e04a0e625b9c (diff) | |
parent | fddf7ea1c1e520f33fa26fe340f3fc107bcc95c8 (diff) | |
download | rails-f4a690dae7eec4ab8c129a0318fadc179e055d80.tar.gz rails-f4a690dae7eec4ab8c129a0318fadc179e055d80.tar.bz2 rails-f4a690dae7eec4ab8c129a0318fadc179e055d80.zip |
Merge pull request #2815 from avakhov/current-page-non-get-requests
current_page? returns false for non-GET requests
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 78245c1f95..dbac2e1fc0 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -304,8 +304,8 @@ class UrlHelperTest < ActiveSupport::TestCase assert_equal "Showing", link_to_if(false, "Showing", url_hash) end - def request_for_url(url) - env = Rack::MockRequest.env_for("http://www.example.com#{url}") + def request_for_url(url, opts = {}) + env = Rack::MockRequest.env_for("http://www.example.com#{url}", opts) ActionDispatch::Request.new(env) end @@ -329,6 +329,12 @@ class UrlHelperTest < ActiveSupport::TestCase assert current_page?("http://www.example.com/?order=desc&page=1") end + def test_current_page_with_not_get_verb + @request = request_for_url("/events", :method => :post) + + assert !current_page?('/events') + end + def test_link_unless_current @request = request_for_url("/") |