Sha256: d0d435eec1c28a4f4689d30afc1bd5d0e5c47d94d8e6dccb2fb11a504dcc2ad3

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require 'rubygems'
require 'test/unit'

require 'action_controller'
require 'action_view'
require 'action_view/template'
require 'action_view/test_case'

require 'stylesheets_for_all'

class TestStylesheetsForAll < ActionView::TestCase
  tests ActionView::Helpers::AssetTagHelper
  tests StylesheetsForAll::ActionViewExtensions

  StyleLinkToTag = {
    %(stylesheet_link_tag("style")) => %(<link href="/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />),
    %(stylesheet_link_tag("style", :type => "foo/bar")) => %(<link href="/stylesheets/style.css" media="all" rel="stylesheet" type="foo/bar" />),
    %(stylesheet_link_tag("style", :media => "screen")) => %(<link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />),
    %(stylesheet_link_tag("style", :media => "screen", :type => "foo/bar")) => %(<link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="foo/bar" />),
  }

  def test_stylesheet_link_tag
    ENV["RAILS_ASSET_ID"] = ""
    StyleLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stylesheets_for_all-0.0.2 test/test_stylesheets_for_all.rb
stylesheets_for_all-0.0.1 test/test_stylesheets_for_all.rb