Test that author details from the session are committed into the repository
This commit is contained in:
@@ -275,6 +275,24 @@ context "Frontend" do
|
|||||||
assert_match "http://example.org/wiki/Home", last_response.headers['Location']
|
assert_match "http://example.org/wiki/Home", last_response.headers['Location']
|
||||||
end
|
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
|
def app
|
||||||
Precious::App
|
Precious::App
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user