Sha256: 8c78270a2abfa19b00103936f56e16cc3f8e300244bfac45a3ec23bff34dfdaf

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe "Helpers:" do
  include StaticMatic::Helpers::AssetsHelper
  include StaticMatic::Helpers::CurrentPathHelper
  include StaticMatic::Helpers::TagHelper
  before do
    setup_staticmatic
    @staticmatic.instance_variable_set("@current_page", "")
  end
  
  context "When using the stylesheet helper" do
    before do
      @links = stylesheets
    end
    
    it "should set up links for all stylesheets" do
      @links.should match(/stylesheets\/application\.css/)
      @links.should match(/stylesheets\/nested\/a_nested_stylesheet\.css/)
      @links.should match(/stylesheets\/sassy\.css/)
    end
    
    it "should not link to partials" do
      @links.should_not match(/\_forms.css/)
    end
    
    it "should setup links for specified stylesheets" do
      stylesheets(:sassy).should match(/stylesheets\/sassy\.css/)
    end
  end
  
  context "When using the stylesheet helper from a sub page" do
    before do
      @staticmatic.instance_variable_set("@current_page", "/sub/index.html")
      @links = stylesheets
    end
    
    it "should link relative to current page" do
      @links.should match(/\.\.\/stylesheets/)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
staticmatic2-2.0.2 spec/helpers/asset_helper_spec.rb
staticmatic2-2.0.1 spec/helpers/asset_helper_spec.rb
staticmatic2-2.0.0 spec/helpers/asset_helper_spec.rb
staticmatic-0.11.1 spec/helpers/asset_helper_spec.rb