Add a 'New Page' button to the /pages browser that allows users to create a new page within a subdirectory.

This commit is contained in:
Darren Oakley
2012-06-22 11:41:42 +01:00
parent 8fd11e8fdb
commit 6e35a09abd
8 changed files with 54 additions and 16 deletions
+11
View File
@@ -32,4 +32,15 @@ context "Precious::Views::Pages" do
@page.instance_variable_set("@results", results)
assert_equal %{<li><a href="/Mordor/Eye-Of-Sauron" class="file">Eye Of Sauron</a></li>\n<li><a href="/pages/Mordor/Orc/" class="folder">Orc</a></li>}, @page.files_folders
end
test "new_page_data_variables within Home directory" do
assert_equal nil, @page.new_page_data_variables
end
test "new_page_data_variables within subdirectory" do
@page.instance_variable_set("@path", "Mordor")
assert_equal ' data-path="Mordor"', @page.new_page_data_variables
@page.instance_variable_set("@path", "Mordor/Eye-Of-Sauron")
assert_equal ' data-path="Mordor/Eye-Of-Sauron"', @page.new_page_data_variables
end
end