Skip to content
Browse files

Merge pull request #875 from PerlDancer/hash-order

don't expect specific order in cookie
  • Loading branch information...
2 parents 6bac57e + d4598c0 commit ae8426ca00cb33a2ac3262424f4cbbc035c3e604 @bigpresh bigpresh committed Dec 15, 2012
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',

0 comments on commit ae8426c

Please sign in to comment.
Something went wrong with that request. Please try again.