Skip to content

Commit

Permalink
more Test::Mojo examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 11, 2012
1 parent 1bb10c5 commit 16cf963
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Test/Mojo.pm
Expand Up @@ -426,6 +426,12 @@ User agent used for testing, defaults to a L<Mojo::UserAgent> object.
# Allow redirects
$t->ua->max_redirects(10);
# Customize all transactions (including followed redirects)
$t->ua->on(start => sub {
my ($ua, $tx) = @_;
$tx->req->headers->accept_language('en-US');
});
# Request with Basic authentication
$t->get_ok($t->ua->app_url->userinfo('sri:secr3t')->path('/secrets'));
Expand Down

0 comments on commit 16cf963

Please sign in to comment.