aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-06-20 11:37:48 -0400
committerGitHub <noreply@github.com>2017-06-20 11:37:48 -0400
commit95ee77b3aeed0eb9cbac22268b398a7917e536d3 (patch)
treeb9480665600e1e592543d1d134fb44dedf201cef /actionview/test
parent70d3c38447eb93950d3d6d61938fe24b7fccf21f (diff)
parent01ddd1cecff3fabd1ecaeb86717612e757b74139 (diff)
downloadrails-95ee77b3aeed0eb9cbac22268b398a7917e536d3.tar.gz
rails-95ee77b3aeed0eb9cbac22268b398a7917e536d3.tar.bz2
rails-95ee77b3aeed0eb9cbac22268b398a7917e536d3.zip
Merge pull request #29503 from savroff/fix_current_page_engine_issue
Fix current_page? helper issue with engine root path
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/url_helper_test.rb16
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("/")