test/unit/page_test.rb in hydeweb-0.1.2 vs test/unit/page_test.rb in hydeweb-0.1.3

- old
+ new

@@ -22,6 +22,37 @@ test "parent" do assert Page['/'].parent.nil? assert Page['/css/style.css'].parent.path == '/index.html' end + + test "siblings" do + # Because it has no parent, technically + page = Page['/about/index.css'] + assert page.siblings.empty? + + page = Page['/hello.html'] + assert_equal %w(/cheers.html /hello.html /hi.html), page.siblings.map(&:path) + end + + test "mimes" do + assert !Page['/css/style.css'].html? + assert Page['/'].html? + assert_equal 'text/css', Page['/css/style.css'].mime_type + assert_equal 'text/html', Page['/about/us.html'].mime_type + assert_equal 'html', Page['/about/us.html'].default_ext + assert_equal 'css', Page['/css/style.css'].default_ext + end + + test "no layout" do + page = Page['/hi.html'] + assert_equal false, page.meta.layout + assert_equal nil, page.layout + assert_equal false, page.layout? + assert_equal page.to_html, page.content + end + + test "html pages should be intact" do + page = Page['/hi'] + assert_equal page.markup, page.content + end end