normalize commit hashes so they at least show 'anonymous' if no git user is set.

This commit is contained in:
rick
2010-08-16 07:36:32 -07:00
parent 763387979a
commit ee04dd84aa
3 changed files with 44 additions and 8 deletions
+15
View File
@@ -38,6 +38,21 @@ context "Wiki" do
%w(Bilbo-Baggins.md Eye-Of-Sauron.md Home.textile My-Precious.md),
pages.map { |p| p.filename }.sort
end
test "normalizes commit hash" do
commit = {:message => 'abc'}
assert_equal({:message => 'abc', :name => 'Anonymous', :email => 'anon@anon.com'},
@wiki.normalize_commit(commit.dup))
commit[:name] = 'bob'
commit[:email] = ''
assert_equal({:message => 'abc', :name => 'bob', :email => 'anon@anon.com'},
@wiki.normalize_commit(commit.dup))
commit[:email] = 'foo@bar.com'
assert_equal({:message => 'abc', :name => 'bob', :email => 'foo@bar.com'},
@wiki.normalize_commit(commit.dup))
end
end
context "Wiki page previewing" do