Fix Two bugs from Toby Bartels

1. Ensure that "rollback" respects locked pages.
2. Expire revisions of an edited page. Use a before_save
   hook to deal with the situation where a page's name
   has been changed.
This commit is contained in:
Jacques Distler 2009-08-04 00:02:04 -05:00
parent 0e0f666fb4
commit 329fafafce
4 changed files with 16 additions and 1 deletions

View file

@ -427,11 +427,15 @@ class WikiControllerTest < ActionController::TestCase
def test_rollback
# rollback shows a form where a revision can be edited.
# its assigns the same as or revision
home_page = Page.find(@home.id)
assert !home_page.locked?(Time.now)
r = process 'rollback', 'web' => 'wiki1', 'id' => 'HomePage', 'rev' => '1'
assert_response(:success)
assert_equal @home, r.template_objects['page']
assert_equal @home.revisions[0], r.template_objects['revision']
home_page = Page.find(@home.id)
assert home_page.locked?(Time.now)
end
def test_atom_with_content