Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6188

Show
Ignore:
Timestamp:
02/21/07 15:58:42 (2 years ago)
Author:
david
Message:

Added subdirectory test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/test/template/asset_tag_helper_test.rb

    r6187 r6188  
    212212 
    213213    assert File.exists?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) 
     214 
    214215  ensure 
    215216    File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')) 
    216217    File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js')) 
     218  end 
     219   
     220  def test_caching_javascript_include_tag_when_caching_on_and_using_subdirectory 
     221    ENV["RAILS_ASSET_ID"] = "" 
     222    ActionController::Base.asset_host = 'http://a%d.example.com' 
     223    ActionController::Base.perform_caching = true 
     224 
     225    assert_dom_equal( 
     226      %(<script src="http://a3.example.com/javascripts/cache/money.js" type="text/javascript"></script>), 
     227      javascript_include_tag(:all, :cache => "cache/money") 
     228    ) 
     229 
     230    assert File.exists?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js')) 
     231  ensure 
     232    File.delete(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'cache', 'money.js')) 
    217233  end 
    218234