Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't expect specific order in cookie

  • Loading branch information...
commit d4598c0c1dc7b5f53a7ab02e646a74579142debd 1 parent 6bac57e
@yanick yanick authored
Showing with 15 additions and 6 deletions.
  1. +15 −6 t/09_cookies/05_api.t
View
21 t/09_cookies/05_api.t
@@ -23,13 +23,22 @@ foreach my $test (@tests) {
"HttpOnly is correctly set";
}
-ok my $c = Dancer::Cookie->new(
- name => 'complex',
- value => { token => 'foo', token_secret => 'bar' },
-);
+{
+ my $values = { token => 'foo', token_secret => 'bar' };
+
+ ok my $c = Dancer::Cookie->new(
+ name => 'complex',
+ value => $values,
+ );
+
+ subtest "cookie header" => sub {
+ ok $c->to_header =~ /^complex=([^;]+);/, "cookie name";
-my $text = $c->to_header;
-like $text, qr/complex=token&foo&token_secret&bar/;
+ my %cookie_values = split '&', $1;
+
+ is_deeply \%cookie_values => $values, "cookie values";
+ };
+}
my $env = {
REQUEST_METHOD => 'GET',
Please sign in to comment.
Something went wrong with that request. Please try again.