aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-23 20:55:22 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-23 20:55:29 -0700
commitd89a33d16216c9c3be719bda735bdc7a7f4bda00 (patch)
tree7e0ce5e2eeb141f71dda3cf99c466d52a4bf5eff /actionpack/test/template
parenta14f4566dd640b1a90e86872d82b83a2282459e6 (diff)
downloadrails-d89a33d16216c9c3be719bda735bdc7a7f4bda00.tar.gz
rails-d89a33d16216c9c3be719bda735bdc7a7f4bda00.tar.bz2
rails-d89a33d16216c9c3be719bda735bdc7a7f4bda00.zip
just use normal ruby for stubbing
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/sprockets_helper_test.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb
index 6ee110f549..1135c55ff0 100644
--- a/actionpack/test/template/sprockets_helper_test.rb
+++ b/actionpack/test/template/sprockets_helper_test.rb
@@ -26,10 +26,8 @@ class SprocketsHelperTest < ActionView::TestCase
@assets.paths << FIXTURES.join("sprockets/app/stylesheets")
@assets.paths << FIXTURES.join("sprockets/app/images")
- application = Object.new
+ application = Struct.new(:config, :assets).new(config, @assets)
Rails.stubs(:application).returns(application)
- application.stubs(:config).returns(config)
- application.stubs(:assets).returns(@assets)
@config = config
@config.action_controller ||= ActiveSupport::InheritableOptions.new
@config.perform_caching = true
@@ -53,7 +51,7 @@ class SprocketsHelperTest < ActionView::TestCase
assert_equal "/dir/audio",
asset_path("/dir/audio")
end
-
+
test "asset_path with absolute urls" do
assert_equal "http://www.example.com/video/play",
asset_path("http://www.example.com/video/play")
@@ -73,7 +71,7 @@ class SprocketsHelperTest < ActionView::TestCase
assert_match %r{http://assets-\d.example.com/assets/logo-[0-9a-f]+.png},
asset_path("logo.png")
end
-
+
test "With a proc asset host that returns no protocol the url should be protocol relative" do
@controller.config.asset_host = Proc.new do |asset|
"assets-999.example.com"