test/test_app.rb in gollum-1.3.1 vs test/test_app.rb in gollum-1.4.2
- old
+ new
@@ -83,10 +83,24 @@
page = @wiki.page('D')
assert_equal 'abc', page.raw_data
assert_equal 'def', page.version.message
end
+ test "creates pages with escaped characters in title" do
+ post "/create", :content => 'abc', :page => 'Title with spaces',
+ :format => 'markdown', :message => 'foo'
+ assert_equal 'http://example.org/Title-with-spaces', last_response.headers['Location']
+ get "/Title-with-spaces"
+ assert_match /abc/, last_response.body
+
+ post "/create", :content => 'ghi', :page => 'Title/with/slashes',
+ :format => 'markdown', :message => 'bar'
+ assert_equal 'http://example.org/Title-with-slashes', last_response.headers['Location']
+ get "/Title-with-slashes"
+ assert_match /ghi/, last_response.body
+ end
+
test "guards against creation of existing page" do
name = "A"
post "/create", :content => 'abc', :page => name,
:format => 'markdown', :message => 'def'
assert last_response.ok?
@@ -98,9 +112,20 @@
test "previews content" do
post "/preview", :content => 'abc', :format => 'markdown'
assert last_response.ok?
end
+
+ test "previews content on the first page of an empty wiki" do
+ @path = cloned_testpath("examples/empty.git")
+ @wiki = Gollum::Wiki.new(@path)
+ Precious::App.set(:gollum_path, @path)
+ Precious::App.set(:wiki_options, {})
+
+ post "/preview", :content => 'abc', :format => 'markdown'
+ assert last_response.ok?
+ end
+
test "reverts single commit" do
page1 = @wiki.page('B')
post "/revert/B/7c45b5f16ff3bae2a0063191ef832701214d4df5"