Sha256: 1cbdb634b458ba3b5a991d0ff13e7a52794f8edf63958dfa72356d523d3080ba

Contents?: true

Size: 1 KB

Versions: 17

Compression:

Stored size: 1 KB

Contents

require 'test_helper'
require 'coffee-rails'

class AssetsTest < ActiveSupport::TestCase
  def setup
    require "rails"
    require "action_controller/railtie"
    require "sprockets/railtie"

    @app = Class.new(Rails::Application)
    @app.config.active_support.deprecation = :stderr
    @app.config.assets.enabled = true
    @app.config.assets.cache_store = [ :file_store, "#{tmp_path}/cache" ]
    @app.paths["log"] = "#{tmp_path}/log/test.log"
    @app.initialize!
  end

  def teardown
    FileUtils.rm_rf "#{tmp_path}/cache"
    FileUtils.rm_rf "#{tmp_path}/log"
    File.delete "#{tmp_path}/coffee-script.js"
  end

  test "coffee-script.js is included in Sprockets environment" do
    @app.assets["coffee-script"].write_to("#{tmp_path}/coffee-script.js")

    assert_match "/lib/assets/javascripts/coffee-script.js.erb", @app.assets["coffee-script"].pathname.to_s
    assert_match "this.CoffeeScript", File.open("#{tmp_path}/coffee-script.js").read
  end

  def tmp_path
    "#{File.dirname(__FILE__)}/tmp"
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/coffee-rails-3.2.2/test/assets_test.rb
coffee-rails-3.2.2 test/assets_test.rb
coffee-rails-3.2.1 test/assets_test.rb
coffee-rails-3.2.0 test/assets_test.rb