middleman/spec/page_alias_and_layouts_spec.rb

22 lines
777 B
Ruby
Raw Normal View History

2009-11-16 20:32:55 +01:00
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