mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
22 lines
777 B
Ruby
22 lines
777 B
Ruby
|
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
|