# Log in as each user
# Specify username and password on the URL
$ua1->get_ok("http://localhost/login?username=test01&password=mypass", "Login 'test01'");
- $ua1->get_ok("http://localhost/login?username=test02&password=mypass", "Login 'test02'");
+ # Could make user2 like user1 above, but use the form to show another way
+ $ua2->submit_form(
+ fields => {
+ username => 'test02',
+ password => 'mypass',
+ });
# Go back to the login page and it should show that we are already logged in
$_->get_ok("http://localhost/login", "Return to '/login'") for $ua1, $ua2;
# Make sure the appropriate logout buttons are displayed
$_->content_contains("/logout\">User Logout</a>",
"Both users should have a 'User Logout'") for $ua1, $ua2;
- $ua1->content_contains("/books/form_create\">Create</a>",
- "Only 'test01' should have a create link");
+ $ua1->content_contains("/books/form_create\">Admin Create</a>",
+ "'test01' should have a create link");
+ $ua2->content_lacks("/books/form_create\">Admin Create</a>",
+ "'test02' should NOT have a create link");
$ua1->get_ok("http://localhost/books/list", "View book list as 'test01'");
Please report any errors, issues or suggestions to the author. The
most recent version of the Catalyst Tutorial can be found at
-L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/Tutorial/>.
+L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
Copyright 2006-2008, Kennedy Clark, under Creative Commons License
(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).