Skip Menu |

This queue is for tickets about the Test-Mojo-More CPAN distribution.

Report information
The Basics
Id: 96202
Status: new
Priority: 0/
Queue: Test-Mojo-More

People
Owner: coolmen [...] cpan.org
Requestors: LEEJO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: (no value)



Subject: _cookie and _flash methods create a new request, which isn't necessary
I don't understand why the _cookie and _flash methods build an entire new app and controller? These result in unnecessary duplicate calls in testing and lead to warnings in earlier versions of Mojolicious. Surely the information is already available in the test object, for example the _cookie method could be replaced with the following: sub _cookie { my ( $self,$name ) = @_; foreach my $cookie ( $self->ua->cookie_jar->all ) { return $cookie if $cookie->name eq $name; } return; } Probably something similar for the _flash and _session. Have a look at Test::Mojo::Session, which has similar functionality. Thanks, Lee.