# Copyright (c) 2009 bivio Software, Inc. All Rights Reserved. # $Id: wiki.btest,v 1.14 2011/10/12 21:10:41 schellj Exp $ test_setup('PetShop', 'groupware'); home_page(); my($search_key) = random_string(); my($f, $uri) = create_forum(); visit_uri($uri = "$uri/wiki"); submit_form(Validate => { public => 1, anon => 'Here is our ^PrivatePage! ' . $search_key, }); verify_no_text('inline WikiText btest'); $uri = get_uri(); follow_link('PrivatePage'); verify_text('not found'); submit_form(Validate => { public => 0, anon => 'v1: go back to the ^StartPage. ' . $search_key, }); verify_uri(qr{/PrivatePage}); verify_no_text('not found'); follow_link('edit'); verify_text('PrivatePage'); verify_no_text('not found'); submit_form(Validate => { public => 0, anon => 'v2: go back to the ^StartPage. ' . $search_key, }); follow_link('StartPage'); submit_form({_anon => $search_key}); my($search_page) = get_uri(); verify_text('Here is our'); verify_text('v2: go back to the'); do_logout(); visit_uri($search_page); verify_text('Here is our'); verify_no_text('go back to the'); visit_uri($uri); follow_link('PrivatePage'); verify_text('Please sign into'); verify_no_text('go back to the'); login_as('demo'); visit_uri($search_page); verify_text('Here is our'); verify_no_text('go back to the'); visit_uri($uri); test_deviance('Forbidden'); follow_link('PrivatePage'); test_conformance(); login_as('root'); visit_uri($uri); follow_link('PrivatePage'); follow_link(qr{edit this page}i); submit_form(Validate => { public => 0, anon => 'v3: go back to the ^StartPage. ' . $search_key, }); visit_uri($search_page); follow_link(qr{go back to the}i); verify_text(qr{go back to the}i); follow_link('Page history'); follow_link(qr{back to current}i); follow_link(qr{edit this page}i); submit_form(Validate => { public => 0, anon => 'v4: go back to the ^StartPage. ' . $search_key, }); follow_link('Page history'); follow_link(qr{^2$}); verify_text(qr{v2: go back to the}i); verify_no_text(qr{edit this page}i); follow_link('Page history'); verify_text(qr{back to current}i); follow_link(qr{^3$}); verify_text(qr{v3: go back to the}i); verify_no_text(qr{edit this page}i);