Sha256: f1dee946b30b8b6cb7fbc363b934e86a8a5b445ac3deef252651bb10691b8bae
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
module Teabag::SpecHelper def stylesheet_link_tag_for_teabag(*sources) sources.collect do |source| asset = defined?(lookup_asset_for_path) ? lookup_asset_for_path(source, type: :stylesheet) : asset_paths.asset_for(source, "css") asset.to_a.map do |dep| stylesheet_link_tag(dep.pathname.to_s, href: asset_src(dep, source), type: "text/css").split("\n") end end.flatten.uniq.join("\n").html_safe end def javascript_include_tag_for_teabag(*sources) options = sources.extract_options! sources.collect do |source| asset = defined?(lookup_asset_for_path) ? lookup_asset_for_path(source, type: :javascript) : asset_paths.asset_for(source, "js") asset.to_a.map do |dep| javascript_include_tag(dep.pathname.to_s, src: asset_src(dep, options[:instrument]), type: "text/javascript").split("\n") end end.flatten.uniq.join("\n").html_safe end def asset_src(dep, instrument = false) params = "?body=1" params << "&instrument=1" if instrument && @suite && @suite.instrument_file?(dep.pathname.to_s) "#{Rails.application.config.assets.prefix}/#{dep.logical_path}#{params}" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
teabag-0.6.0 | app/helpers/teabag/spec_helper.rb |