From bbc19d180036bb14a3ed0411c72106eb6066e21e Mon Sep 17 00:00:00 2001 From: Neon Date: Thu, 24 May 2012 00:04:45 +0900 Subject: [PATCH] Added testcase for 'open existing parent' --- test/test_app.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/test_app.rb b/test/test_app.rb index f83f9922..5eb90803 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -171,3 +171,34 @@ context "Frontend" do Precious::App end end + +context "Frontend with page-file-dir" do + include Rack::Test::Methods + + setup do + @path = cloned_testpath("examples/page_file_dir.git") + @wiki = Gollum::Wiki.new(@path, { :page_file_dir => "docs" }) + Precious::App.set(:gollum_path, @path) + Precious::App.set(:wiki_options, { :page_file_dir => "docs" }) + end + + teardown do + FileUtils.rm_rf(@path) + end + + test "open existing parent" do + get "/" + assert last_response.ok? + + post "/create", :content => "asdf", :page => "bar", + :format => 'markdown' + follow_redirect! + assert last_response.ok? + + assert_not_match /Duplicate page/, last_response.body + end + + def app + Precious::App + end +end