diff options
author | savroff <savroff@gmail.com> | 2017-06-19 18:01:20 -0400 |
---|---|---|
committer | savroff <savroff@gmail.com> | 2017-06-19 18:01:20 -0400 |
commit | 0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5 (patch) | |
tree | 90c4433343500ce20c42648ae2a1904091a239d5 /actionview/test | |
parent | b37aa68ff637c4ce1cfd9f6eaec659bc98a1e1b5 (diff) | |
download | rails-0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5.tar.gz rails-0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5.tar.bz2 rails-0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5.zip |
Fix current_page? helper issue with engine root path
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/url_helper_test.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 30dc719ce6..bdedbeba92 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -15,6 +15,10 @@ class UrlHelperTest < ActiveSupport::TestCase get "/other" => "foo#other" get "/article/:id" => "foo#article", :as => :article get "/category/:category" => "foo#category" + + scope :engine do + get "/" => "foo#bar" + end end include ActionView::Helpers::UrlHelper @@ -521,10 +525,10 @@ 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) + def test_current_page_with_scope_that_match + @request = request_for_url("/engine/") - assert !current_page?("/events") + assert current_page?("/engine") end def test_current_page_with_escaped_params @@ -553,6 +557,12 @@ class UrlHelperTest < ActiveSupport::TestCase assert current_page?("/posts/") 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("/") |