Test that author details from the session are committed into the repository

This commit is contained in:
Keith Duncan
2012-09-16 16:49:17 +01:00
parent ac405803e8
commit 30c2e675da
+18
View File
@@ -274,6 +274,24 @@ context "Frontend" do
get "/"
assert_match "http://example.org/wiki/Home", last_response.headers['Location']
end
test "author details in session are used" do
page1 = @wiki.page('A')
gollum_author = { :name => 'ghi', :email => 'jkl' }
session = { 'gollum.author' => gollum_author }
post "/edit/A", { :content => 'abc', :page => 'A', :format => page1.format, :message => 'def' }, { 'rack.session' => session }
follow_redirect!
assert last_response.ok?
@wiki.clear_cache
page2 = @wiki.page(page1.name)
author = page2.version.author
assert_equal 'ghi', author.name
assert_equal 'jkl', author.email
end
def app
Precious::App