Fix metadata tests
This commit is contained in:
@@ -13,6 +13,9 @@ ENV['RACK_ENV'] = 'test'
|
||||
require 'gollum'
|
||||
require 'gollum/frontend/app'
|
||||
|
||||
# Disable the metadata feature
|
||||
$METADATA = false
|
||||
|
||||
# Make sure we're in the test dir, the tests expect that to be the current
|
||||
# directory.
|
||||
TEST_DIR = File.join(File.dirname(__FILE__), *%w[.])
|
||||
|
||||
+2
-2
@@ -627,7 +627,7 @@ np.array([[2,2],[1,3]],np.float)
|
||||
assert_not_nil rendered.match(output)
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
if $METADATA #########################################################################
|
||||
#
|
||||
# Metadata Blocks
|
||||
#
|
||||
@@ -677,7 +677,7 @@ np.array([[2,2],[1,3]],np.float)
|
||||
assert_equal output, rendered
|
||||
assert_equal result, page.metadata
|
||||
end
|
||||
|
||||
end # if $METADATA
|
||||
#########################################################################
|
||||
#
|
||||
# Various
|
||||
|
||||
+2
-1
@@ -228,11 +228,12 @@ context "within a sub-directory" do
|
||||
assert page.footer.raw_data =~ /^Lord of the Rings/
|
||||
end
|
||||
|
||||
if $METADATA
|
||||
test "get metadata on page" do
|
||||
page = @wiki.page('Elrond')
|
||||
assert_equal Gollum::Page, page.class
|
||||
assert_equal 'elf', page.metadata['race']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -198,6 +198,7 @@ context "Wiki page writing" do
|
||||
assert_equal cd[:email], @wiki.repo.commits.first.author.email
|
||||
end
|
||||
|
||||
if $METADATA
|
||||
test "page title override with metadata" do
|
||||
@wiki.write_page("Gollum", :markdown, "<!-- --- title: Over -->", commit_details)
|
||||
|
||||
@@ -205,6 +206,7 @@ context "Wiki page writing" do
|
||||
|
||||
assert_equal 'Over', page.url_path_title
|
||||
end
|
||||
end
|
||||
|
||||
test "update page with format change" do
|
||||
@wiki.write_page("Gollum", :markdown, "# Gollum", commit_details)
|
||||
|
||||
Reference in New Issue
Block a user