From 30c2e675da57cc3b861fa589f7ceceb23479899b Mon Sep 17 00:00:00 2001 From: Keith Duncan Date: Sun, 16 Sep 2012 16:49:17 +0100 Subject: [PATCH] Test that author details from the session are committed into the repository --- test/test_app.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_app.rb b/test/test_app.rb index 52983290..5da184dc 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -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