Skip to content

Commit

Permalink
don't expect specific order in cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
yanick committed Dec 15, 2012
1 parent 6bac57e commit d4598c0
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions t/09_cookies/05_api.t
Expand Up @@ -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',
Expand Down

0 comments on commit d4598c0

Please sign in to comment.