Fix to #255 - Author cookie expiry
This commit is contained in:
parent
9ea6e6ae65
commit
50b2cbd693
|
@ -185,7 +185,7 @@ class WikiController < ApplicationController
|
||||||
|
|
||||||
def save
|
def save
|
||||||
redirect_home if @page_name.nil?
|
redirect_home if @page_name.nil?
|
||||||
cookies['author'] = @params['author']
|
cookies['author'] = { :value => @params['author'], :expires => Time.utc(2030) }
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if @page
|
if @page
|
||||||
|
|
|
@ -513,6 +513,7 @@ class WikiControllerTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_redirected_to :web => 'wiki1', :action => 'show', :id => 'NewPage'
|
assert_redirected_to :web => 'wiki1', :action => 'show', :id => 'NewPage'
|
||||||
assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
|
assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
|
||||||
|
assert_equal Time.utc(2030), r.cookies['author'].expires
|
||||||
new_page = @wiki.read_page('wiki1', 'NewPage')
|
new_page = @wiki.read_page('wiki1', 'NewPage')
|
||||||
assert_equal 'Contents of a new page', new_page.content
|
assert_equal 'Contents of a new page', new_page.content
|
||||||
assert_equal 'AuthorOfNewPage', new_page.author
|
assert_equal 'AuthorOfNewPage', new_page.author
|
||||||
|
|
Loading…
Reference in a new issue