Sha256: 9b3c0d4ecbf22b1fa6e9a4e3a55e2f8ab5aecb141002947c544c73fd987362ce

Contents?: true

Size: 1.29 KB

Versions: 11

Compression:

Stored size: 1.29 KB

Contents

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

describe "StaticMatic::Render" do
  before do
    setup_staticmatic
  end
  
  it "generate content with a layout" do
    content = @staticmatic.generate_html_with_layout("index")
    content.should match(/StaticMatic/)
    content.should match(/This is some test content/)
  end
  
  it "generate html with layout assigned in template" do
    content = @staticmatic.generate_html_with_layout("layout_test")
    content.should match(/Alternate Layout/)
  end
  
  it "generate css" do
    content = @staticmatic.generate_css("application")
  end
  
  it "find source filename from path" do
    @staticmatic.source_template_from_path("@base_dir/src/stylesheets/application.css")[1].should == "application"
  end
  
  it "find layout from passed path" do
    @staticmatic.determine_layout("test/projects").should == "projects"
  end
  
  context "handling scss" do
    it "should generate css from scss" do
      @staticmatic.generate_css("sassy").should match(/color\: \#3bbfce\;/)
    end
  end
  
  it "should clear template variables" do
    @staticmatic.generate_html("page_one")
    @staticmatic.clear_template_variables!
    output = @staticmatic.generate_html("page_two")
    output.should match(/The variable is/)
    output.should_not match(/hello/)
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
staticmatic2-2.0.2 spec/render_spec.rb
staticmatic2-2.0.1 spec/render_spec.rb
staticmatic2-2.0.0 spec/render_spec.rb
staticmatic-0.11.1 spec/render_spec.rb
staticmatic-0.11.0 spec/render_spec.rb
staticmatic-0.11.0.alpha.10 spec/render_spec.rb
staticmatic-0.11.0.alpha.9 spec/render_spec.rb
staticmatic-0.11.0.alpha.8 spec/render_spec.rb
staticmatic-0.11.0.alpha.7 spec/render_spec.rb
staticmatic-0.11.0.alpha.6 spec/render_spec.rb
staticmatic-0.11.0.alpha.5 spec/render_spec.rb