Skip to content

Commit

Permalink
Merge pull request #7728 from guilleiguaran/fix-asset-test
Browse files Browse the repository at this point in the history
Update asset test to match one in sprockets-rails
  • Loading branch information
spastorino committed Sep 22, 2012
2 parents ec28c05 + fd8b9be commit 7be8809
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions railties/test/application/assets_test.rb
Expand Up @@ -236,21 +236,24 @@ def show_detailed_exceptions?() true end
test "assets raise AssetNotPrecompiledError when manifest file is present and requested file isn't precompiled if digest is disabled" do test "assets raise AssetNotPrecompiledError when manifest file is present and requested file isn't precompiled if digest is disabled" do
app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'app' %>" app_file "app/views/posts/index.html.erb", "<%= javascript_include_tag 'app' %>"
add_to_config "config.assets.compile = false" add_to_config "config.assets.compile = false"
add_to_config "config.assets.digest = false"


app_file "config/routes.rb", <<-RUBY app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do AppTemplate::Application.routes.draw do
get '/posts', :to => "posts#index" get '/posts', :to => "posts#index"
end end
RUBY RUBY


ENV["RAILS_ENV"] = "development" ENV["RAILS_ENV"] = "production"
precompile! precompile!


# Create file after of precompile # Create file after of precompile
app_file "app/assets/javascripts/app.js", "alert();" app_file "app/assets/javascripts/app.js", "alert();"


require "#{app_path}/config/environment" require "#{app_path}/config/environment"
class ::PostsController < ActionController::Base ; end class ::PostsController < ActionController::Base
def show_detailed_exceptions?() true end
end


get '/posts' get '/posts'
assert_match(/AssetNotPrecompiledError/, last_response.body) assert_match(/AssetNotPrecompiledError/, last_response.body)
Expand Down

0 comments on commit 7be8809

Please sign in to comment.