aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/asset_tag_helper_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2012-10-12 17:07:17 -0500
committerJoshua Peek <josh@joshpeek.com>2012-10-12 17:07:17 -0500
commitc3cff4d4219c556a5bfe4cbd72b96723b1633122 (patch)
treec7d06552789267c7d8014129f103644c51364de8 /actionpack/test/template/asset_tag_helper_test.rb
parent1e2b0ce95e48463361111ceae6eed7d4ad5462f0 (diff)
downloadrails-c3cff4d4219c556a5bfe4cbd72b96723b1633122.tar.gz
rails-c3cff4d4219c556a5bfe4cbd72b96723b1633122.tar.bz2
rails-c3cff4d4219c556a5bfe4cbd72b96723b1633122.zip
Ensure AssetUrlHelper can be mixed into AC::Base
Diffstat (limited to 'actionpack/test/template/asset_tag_helper_test.rb')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 2059501fcc..08c927a4ab 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -13,6 +13,8 @@ end
class AssetTagHelperTest < ActionView::TestCase
tests ActionView::Helpers::AssetTagHelper
+ attr_reader :request
+
def setup
super
silence_warnings do
@@ -598,6 +600,8 @@ end
class AssetTagHelperNonVhostTest < ActionView::TestCase
tests ActionView::Helpers::AssetTagHelper
+ attr_reader :request
+
def setup
super
@controller = BasicController.new
@@ -720,3 +724,32 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase
assert_dom_equal(%(/collaboration/hieraki/stylesheets/foo.css), stylesheet_path("foo"))
end
end
+
+class AssetUrlHelperControllerTest < ActionView::TestCase
+ tests ActionView::Helpers::AssetUrlHelper
+
+ def setup
+ super
+
+ @controller = BasicController.new
+ @controller.extend ActionView::Helpers::AssetUrlHelper
+
+ @request = Class.new do
+ attr_accessor :script_name
+ def protocol() 'http://' end
+ def ssl?() false end
+ def host_with_port() 'www.example.com' end
+ def base_url() 'http://www.example.com' end
+ end.new
+
+ @controller.request = @request
+ end
+
+ def test_asset_path
+ assert_equal "/foo", @controller.asset_path("foo")
+ end
+
+ def test_asset_url
+ assert_equal "http://www.example.com/foo", @controller.asset_url("foo")
+ end
+end