After each *_ok method call you can access the most recent response as $t->tx->res (if $t is your Test::Mojo object)
On Wed, Nov 18, 2015 at 4:41 PM, Pavel Serikov <[email protected]> wrote: > How to capture output of one route and then use it in test for another > route? > > E.g. this algorithm of test: > > 1) got *$object_id* as result of post_ok > <https://metacpan.org/pod/Test::Mojo#post_ok> (CREATE, post '/api/:coll' > route) > 2) use this *$object_id* in put_ok > <https://metacpan.org/pod/Test::Mojo#put_ok> (UPDATE same object, put > '/api/:coll/:id' route) > 3) use it (or other param) in get_ok > <https://metacpan.org/pod/Test::Mojo#get_ok> > 4) .. delete_ok <https://metacpan.org/pod/Test::Mojo#delete_ok> > > etc. > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/mojolicious. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
