Skip to content

Commit

Permalink
added example for testing custom transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 13, 2012
1 parent e352a50 commit 628330b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.81 2012-04-12
2.81 2012-04-13
- Improved all debug messages.
- Improved documentation.
- Improved tests.
Expand Down
7 changes: 7 additions & 0 deletions lib/Test/Mojo.pm
Expand Up @@ -416,6 +416,13 @@ Current transaction, usually a L<Mojo::Transaction::HTTP> object.
is $t->tx->res->json->{foo}, 'bar', 'right value';
ok $t->tx->res->is_multipart, 'multipart content';
# Test custom transaction
my $tx = $t->ua->build_form_tx('/users' => {name => 'sri', id => 99});
$tx->req->method('PUT');
$t->tx($t->ua->start($tx))
->status_is(200)
->text_is('div#message' => 'User has been replaced.');
=head2 C<ua>
my $ua = $t->ua;
Expand Down

0 comments on commit 628330b

Please sign in to comment.