summaryrefslogtreecommitdiff
path: root/t/error.t
diff options
context:
space:
mode:
Diffstat (limited to 't/error.t')
-rw-r--r--t/error.t18
1 files changed, 7 insertions, 11 deletions
diff --git a/t/error.t b/t/error.t
index 59794ca..973da16 100644
--- a/t/error.t
+++ b/t/error.t
@@ -4,22 +4,18 @@ use t::Helper;
my $app = t::Helper->make_app;
my $t = Test::Mojo->new($app);
-Mojo::Util::monkey_patch('Mojolicious::Plugin::OAuth2', _ua => sub { $t->ua });
+$t->app->ua->server($t->ua->server);
$app->routes->get(
'/oauth-error' => sub {
my $c = shift;
- $c->oauth2->get_token_p('test')->then(
- sub {
- return unless my $provider_res = shift;
- return $c->render(text => "Token $provider_res->{access_token}");
- }
- )->catch(
- sub {
- return $c->render(text => shift, status => 500);
- }
- );
+ $c->oauth2->get_token_p('test')->then(sub {
+ return unless my $provider_res = shift;
+ return $c->render(text => "Token $provider_res->{access_token}");
+ })->catch(sub {
+ return $c->render(text => shift, status => 500);
+ });
}
);