Permalink
Browse files

a few more cookie jar tests

  • Loading branch information...
kraih committed Feb 13, 2018
1 parent 22abdf9 commit c9e76b8fe41ccc44a9b6593a52bf0208d01b6388
Showing with 6 additions and 2 deletions.
  1. +6 −2 t/mojo/cookiejar.t
View
@@ -254,6 +254,10 @@ $tx->req->url->parse('http://mojolicious.org/perldoc');
$jar->prepare($tx);
is $tx->req->cookie('foo')->name, 'foo', 'right name';
is $tx->req->cookie('foo')->value, 'without', 'right value';
+is $jar->all->[0]->name, 'foo', 'right name';
+is $jar->all->[0]->value, 'without', 'right value';
+is $jar->all->[0]->domain, 'mojolicious.org', 'right domain';
+is $jar->all->[1], undef, 'no second cookie';
$tx = Mojo::Transaction::HTTP->new;
$tx->req->url->parse('http://www.mojolicious.org/perldoc');
$jar->prepare($tx);
@@ -284,8 +288,8 @@ $tx = Mojo::Transaction::HTTP->new;
$tx->req->url->parse('http://example.com/test');
$jar->prepare($tx);
$cookies = $tx->req->every_cookie('foo');
-is $cookies->[0]->name, 'foo', 'right name';
-is $cookies->[0]->value, 'with', 'right value';
+is $cookies->[0]->name, 'foo', 'right name';
+is $cookies->[0]->value, 'with', 'right value';
is $cookies->[1], undef, 'no second cookie';
$tx = Mojo::Transaction::HTTP->new;
$tx->req->url->parse('http://www.example.com/test');

0 comments on commit c9e76b8

Please sign in to comment.