1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/spec/page_alias_and_layouts_spec.rb
2009-11-16 16:14:51 -08:00

22 lines
No EOL
777 B
Ruby
Executable file

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