Sha256: 03a48bc8a1831bf2a22b1d1c8dacfdcba4802fa84b59b01063a8ff7d76486e63

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

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

describe "Helpers:" do
  include StaticMatic::Helpers
  before do
    setup_staticmatic
    @staticmatic.instance_variable_set("@current_page", "")
  end
  
  it "should include custom helper" do
    content = @staticmatic.generate_html_with_layout("index")
    content.should match(/Hello, Steve!/)
  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/)
    end
    
    it "should not link to partials" do
      @links.should_not match(/\_forms.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

6 entries across 6 versions & 1 rubygems

Version Path
staticmatic-0.11.0.alpha.1 spec/helpers_spec.rb
staticmatic-0.11.0.alpha.0 spec/helpers_spec.rb
staticmatic-0.10.8 spec/helpers_spec.rb
staticmatic-0.10.7 spec/helpers_spec.rb
staticmatic-0.10.6 spec/helpers_spec.rb
staticmatic-0.10.5 spec/helpers_spec.rb