1 # Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the
15 # Free Software Foundation, Inc.
16 # 59 Temple Place, Suite 330
17 # Boston, MA 02111-1307 USA
21 use Test::More tests => 37;
25 $page = get_page('action=history id=hist');
27 'No other revisions available',
28 'View current revision',
30 test_page_negative($page,
31 'View other revisions',
32 'Mark this page for deletion');
34 test_page(update_page('hist', 'testing', 'test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary'),
37 'View other revisions');
39 test_page_negative(get_page('action=history id=hist'),
40 'Mark this page for deletion');
41 $page = get_page('action=history id=hist username=me');
43 'test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary test summary',
44 'View current revision',
47 'Mark this page for deletion');
48 test_page_negative($page,
49 'No other revisions available',
50 'View other revisions',
53 test_page(update_page('hist', 'Tesla', 'Power'),
56 'View other revisions');
58 $page = get_page('action=history id=hist username=me');
62 'View current revision',
66 'name="rollback-\d+"',
67 'Mark this page for deletion');
68 test_page_negative($page,
70 'No other revisions available',
71 'View other revisions');
73 '//table[@class="history"]/tr[position()=2]/td[position()=1]/input[@name="diffrevision"][@value="2"]',
74 '//table[@class="history"]/tr[position()=2]/td[position()=2]/input[@name="revision"][@value=""][@checked="checked"]',
75 '//table[@class="history"]/tr[position()=2]/td[position()=3]/a[text()="Revision 2"]',
76 '//table[@class="history"]/tr[position()=3]/td[position()=1]/input[@name="diffrevision"][@value="1"][@checked="checked"]',
77 '//table[@class="history"]/tr[position()=3]/td[position()=2]/input[@name="revision"][@value="1"]',
78 '//table[@class="history"]/tr[position()=3]/td[position()=3]/a[text()="Revision 1"]');