update frontend tests to use sample 'revert' repo

This commit is contained in:
rick
2010-12-09 17:00:52 -08:00
parent 79a1fb860d
commit 1875eef8f6
12 changed files with 19 additions and 19 deletions
+1
View File
@@ -0,0 +1 @@
add footer and sidebar
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
7c45b5f16ff3bae2a0063191ef832701214d4df5 refs/heads/master
7c45b5f16ff3bae2a0063191ef832701214d4df5 refs/remotes/origin/HEAD
7c45b5f16ff3bae2a0063191ef832701214d4df5 refs/remotes/origin/master
+2 -1
View File
@@ -1 +1,2 @@
0000000000000000000000000000000000000000 7c45b5f16ff3bae2a0063191ef832701214d4df5 rick <technoweenie@gmail.com> 1291848403 -0800 clone: from /Users/rick/p/gollum/test/examples/revert.git 0000000000000000000000000000000000000000 7c45b5f16ff3bae2a0063191ef832701214d4df5 rick <technoweenie@gmail.com> 1291942707 -0800 clone: from /Users/rick/p/gollum/test/examples/revert.git
7c45b5f16ff3bae2a0063191ef832701214d4df5 f403b791119f8232b7cb0ba455c624ac6435f433 rick <technoweenie@gmail.com> 1291942743 -0800 commit: add footer and sidebar
@@ -1 +1,2 @@
0000000000000000000000000000000000000000 7c45b5f16ff3bae2a0063191ef832701214d4df5 rick <technoweenie@gmail.com> 1291848403 -0800 clone: from /Users/rick/p/gollum/test/examples/revert.git 0000000000000000000000000000000000000000 7c45b5f16ff3bae2a0063191ef832701214d4df5 rick <technoweenie@gmail.com> 1291942707 -0800 clone: from /Users/rick/p/gollum/test/examples/revert.git
7c45b5f16ff3bae2a0063191ef832701214d4df5 f403b791119f8232b7cb0ba455c624ac6435f433 rick <technoweenie@gmail.com> 1291942743 -0800 commit: add footer and sidebar
-1
View File
@@ -1,3 +1,2 @@
# pack-refs with: peeled # pack-refs with: peeled
7c45b5f16ff3bae2a0063191ef832701214d4df5 refs/heads/master
7c45b5f16ff3bae2a0063191ef832701214d4df5 refs/remotes/origin/master 7c45b5f16ff3bae2a0063191ef832701214d4df5 refs/remotes/origin/master
@@ -0,0 +1 @@
f403b791119f8232b7cb0ba455c624ac6435f433
+13 -13
View File
@@ -5,7 +5,7 @@ context "Frontend" do
include Rack::Test::Methods include Rack::Test::Methods
setup do setup do
@path = cloned_testpath("examples/lotr.git") @path = cloned_testpath("examples/revert.git")
@wiki = Gollum::Wiki.new(@path) @wiki = Gollum::Wiki.new(@path)
Precious::App.set(:gollum_path, @path) Precious::App.set(:gollum_path, @path)
end end
@@ -15,8 +15,8 @@ context "Frontend" do
end end
test "edits page" do test "edits page" do
page_1 = @wiki.page('Bilbo Baggins') page_1 = @wiki.page('A')
post "/edit/#{Gollum::Page.cname page_1.name}", :content => 'abc', post "/edit/A", :content => 'abc',
:format => page_1.format, :message => 'def' :format => page_1.format, :message => 'def'
follow_redirect! follow_redirect!
assert last_response.ok? assert last_response.ok?
@@ -29,11 +29,11 @@ context "Frontend" do
end end
test "edits page footer and sidebar" do test "edits page footer and sidebar" do
page_1 = @wiki.page('Bilbo Baggins') page_1 = @wiki.page('A')
foot_1 = page_1.footer foot_1 = page_1.footer
side_1 = page_1.sidebar side_1 = page_1.sidebar
post "/edit/#{Gollum::Page.cname page_1.name}", post "/edit/A",
:footer => 'footer', :sidebar => 'sidebar', :footer => 'footer', :sidebar => 'sidebar',
:format => page_1.format, :message => 'def' :format => page_1.format, :message => 'def'
follow_redirect! follow_redirect!
@@ -55,34 +55,34 @@ context "Frontend" do
end end
test "renames page" do test "renames page" do
page_1 = @wiki.page('Bilbo Baggins') page_1 = @wiki.page('B')
post "/edit/#{Gollum::Page.cname page_1.name}", :content => 'abc', post "/edit/B", :content => 'abc',
:rename => "Bilbo Whatever", :rename => "C",
:format => page_1.format, :message => 'def' :format => page_1.format, :message => 'def'
follow_redirect! follow_redirect!
assert last_response.ok? assert last_response.ok?
@wiki.clear_cache @wiki.clear_cache
assert_nil @wiki.page(page_1.name) assert_nil @wiki.page("B")
page_2 = @wiki.page('Bilbo Whatever') page_2 = @wiki.page('C')
assert_equal 'abc', page_2.raw_data assert_equal 'abc', page_2.raw_data
assert_equal 'def', page_2.version.message assert_equal 'def', page_2.version.message
assert_not_equal page_1.version.sha, page_2.version.sha assert_not_equal page_1.version.sha, page_2.version.sha
end end
test "creates page" do test "creates page" do
post "/create", :content => 'abc', :page => "Newbie", post "/create", :content => 'abc', :page => "D",
:format => 'markdown', :message => 'def' :format => 'markdown', :message => 'def'
follow_redirect! follow_redirect!
assert last_response.ok? assert last_response.ok?
page = @wiki.page('Newbie') page = @wiki.page('D')
assert_equal 'abc', page.raw_data assert_equal 'abc', page.raw_data
assert_equal 'def', page.version.message assert_equal 'def', page.version.message
end end
test "guards against creation of existing page" do test "guards against creation of existing page" do
name = "Bilbo Baggins" name = "A"
post "/create", :content => 'abc', :page => name, post "/create", :content => 'abc', :page => name,
:format => 'markdown', :message => 'def' :format => 'markdown', :message => 'def'
assert last_response.ok? assert last_response.ok?