Sha256: c6f1089872586e681a6a9efd7ebbfdd57b0ba459fc59870be9d13dd714b047fb

Contents?: true

Size: 777 Bytes

Versions: 10

Compression:

Stored size: 777 Bytes

Contents

require File.join(File.dirname(__FILE__), "spec_helper")

base = ::Middleman::Base
base.set :root, File.join(File.dirname(__FILE__), "fixtures", "sample")

describe "Custom layout" do
  it "should use custom layout" do
    base.page "/custom-layout.html", :layout => :custom
    browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
    browser.get("/custom-layout.html")
    browser.last_response.body.should include("Custom Layout")
  end
  
  it "should use custom layout with_layout method" do
    base.with_layout :layout => :custom do
      page "/custom-layout.html"
    end
    browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
    browser.get("/custom-layout.html")
    browser.last_response.body.should include("Custom Layout")
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
middleman-0.11.5 spec/page_alias_and_layouts_spec.rb
middleman-0.11.4 spec/page_alias_and_layouts_spec.rb
middleman-0.11.3 spec/page_alias_and_layouts_spec.rb
middleman-0.11.2 spec/page_alias_and_layouts_spec.rb
middleman-0.11.1 spec/page_alias_and_layouts_spec.rb
middleman-0.11.0 spec/page_alias_and_layouts_spec.rb
middleman-0.10.17 spec/page_alias_and_layouts_spec.rb
middleman-0.10.16 spec/page_alias_and_layouts_spec.rb
middleman-0.10.15 spec/page_alias_and_layouts_spec.rb
middleman-0.10.14 spec/page_alias_and_layouts_spec.rb