Fix to #255 - Author cookie expiry

This commit is contained in:
Alexey Verkhovsky 2005-10-20 01:18:15 +00:00
parent 9ea6e6ae65
commit 50b2cbd693
2 changed files with 2 additions and 1 deletions

View file

@ -185,7 +185,7 @@ class WikiController < ApplicationController
def save
redirect_home if @page_name.nil?
cookies['author'] = @params['author']
cookies['author'] = { :value => @params['author'], :expires => Time.utc(2030) }
begin
if @page

View file

@ -513,6 +513,7 @@ class WikiControllerTest < Test::Unit::TestCase
assert_redirected_to :web => 'wiki1', :action => 'show', :id => 'NewPage'
assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
assert_equal Time.utc(2030), r.cookies['author'].expires
new_page = @wiki.read_page('wiki1', 'NewPage')
assert_equal 'Contents of a new page', new_page.content
assert_equal 'AuthorOfNewPage', new_page.author