Permalink
Browse files

just use normal ruby for stubbing

  • Loading branch information...
1 parent a14f456 commit d89a33d16216c9c3be719bda735bdc7a7f4bda00 @tenderlove tenderlove committed Jul 24, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 actionpack/test/template/sprockets_helper_test.rb
@@ -26,10 +26,8 @@ def host_with_port() 'localhost' end
@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 @@ def url_for(*args)
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 @@ def url_for(*args)
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"

0 comments on commit d89a33d

Please sign in to comment.