Sha256: 9d69af700d3ded2e47730049604161518fd7d29d07aa987d662415c31602abe5

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

require "spec_helper"

describe "Helpers:" do
  include StaticMatic::Helpers::AssetsHelper
  include StaticMatic::Helpers::CurrentPathHelper
  include StaticMatic::Helpers::TagHelper
  before do
    setup_staticmatic
  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
      @links = stylesheets
    end
    
    it "should link relative to current page" do
      @links.should match(/\.\.\/stylesheets/)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
staticmatic2-2.1.8 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.7 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.6 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.5 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.4 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.3 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.2 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.1 spec/helpers/asset_helper_spec.rb
staticmatic2-2.1.0 spec/helpers/asset_helper_spec.rb