aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2017-02-20 14:37:00 +0000
committerAndrew White <andrew.white@unboxed.co>2017-02-21 15:30:47 +0000
commitd67e2520289745913e7bab9a852c86b99245f738 (patch)
treeb8dd6ef5bafa084ae8ff9442b59714d373e9f0bc /actionpack
parent7d1e738057cead1970d8aca31310a51a59f7235f (diff)
downloadrails-d67e2520289745913e7bab9a852c86b99245f738.tar.gz
rails-d67e2520289745913e7bab9a852c86b99245f738.tar.bz2
rails-d67e2520289745913e7bab9a852c86b99245f738.zip
Add test for calling a url helper in Mapper#direct
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/dispatch/routing/custom_url_helpers_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing/custom_url_helpers_test.rb b/actionpack/test/dispatch/routing/custom_url_helpers_test.rb
index bf4b323cf0..22e8bbf21e 100644
--- a/actionpack/test/dispatch/routing/custom_url_helpers_test.rb
+++ b/actionpack/test/dispatch/routing/custom_url_helpers_test.rb
@@ -32,6 +32,7 @@ class TestCustomUrlHelpers < ActionDispatch::IntegrationTest
direct(:website) { "http://www.rubyonrails.org" }
direct("string") { "http://www.rubyonrails.org" }
+ direct(:helper) { basket_url }
direct(:linkable) { |linkable| [:"#{linkable.linkable_type}", { id: linkable.id }] }
direct(:params) { |params| params }
direct(:symbol) { :basket }
@@ -65,6 +66,9 @@ class TestCustomUrlHelpers < ActionDispatch::IntegrationTest
assert_equal "http://www.rubyonrails.org", string_path
assert_equal "http://www.rubyonrails.org", Routes.url_helpers.string_path
+ assert_equal "http://www.example.com/basket", helper_url
+ assert_equal "http://www.example.com/basket", Routes.url_helpers.helper_url
+
assert_equal "/categories/1", linkable_path(@category)
assert_equal "/categories/1", Routes.url_helpers.linkable_path(@category)
assert_equal "/collections/2", linkable_path(@collection)
@@ -99,6 +103,9 @@ class TestCustomUrlHelpers < ActionDispatch::IntegrationTest
assert_equal "http://www.rubyonrails.org", string_url
assert_equal "http://www.rubyonrails.org", Routes.url_helpers.string_url
+ assert_equal "http://www.example.com/basket", helper_url
+ assert_equal "http://www.example.com/basket", Routes.url_helpers.helper_url
+
assert_equal "http://www.example.com/categories/1", linkable_url(@category)
assert_equal "http://www.example.com/categories/1", Routes.url_helpers.linkable_url(@category)
assert_equal "http://www.example.com/collections/2", linkable_url(@collection)