Sha256: 8f0794fbb0aeb083e62777f87b6f96526b2ce56610e9bef0905cb379e2eb933c
Contents?: true
Size: 1.72 KB
Versions: 27
Compression:
Stored size: 1.72 KB
Contents
# encoding: utf-8 require 'spec_helper' require 'classy_assets' describe ClassyAssets do before do ClassyAssets.config do |config| config.asset_root = File.expand_path('../support', __FILE__) config.asset_debug = false config.asset_digest = false config.asset_host = nil config.asset_paths = Dir.glob(File.join(config.asset_root, config.asset_prefix, '*')) end end context "default configuration" do it "returns the url to the asset" do asset_url = ClassyAssets.asset_url_for 'application.js' asset_url.must_equal '/assets/application.js' end end context "debug mode" do before do ClassyAssets.config.asset_debug = true end after do ClassyAssets.config.asset_debug = false end it "returns the debug url to the asset" do asset_url = ClassyAssets.asset_url_for 'application.js' asset_url.must_equal '/assets/application.js?body=1' end end context "digest" do before do ClassyAssets.config.asset_digest = true @digest = ClassyAssets.sprockets.digest end after do ClassyAssets.config.asset_digest = false end it "returns the digest url to the asset" do asset_url = ClassyAssets.asset_url_for 'application.js' asset_url.must_equal "/assets/#{ClassyAssets.sprockets['application.js'].digest_path}" end end context "asset host" do before do ClassyAssets.config.asset_host = 'http://example.com' end after do ClassyAssets.config.asset_host = nil end it "returns the digest url to the asset" do asset_url = ClassyAssets.asset_url_for 'application.js' asset_url.must_equal "http://example.com/assets/application.js" end end end
Version data entries
27 entries across 27 versions & 1 rubygems