Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

don't expect specific order in cookie #875

Merged
merged 1 commit into from

2 participants

@yanick
Owner

No description provided.

@bigpresh bigpresh merged commit ae8426c into devel
@bigpresh
Owner

Perfect, thanks @yanick !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 15, 2012
  1. @yanick
This page is out of date. Refresh to see the latest.
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',
Something went wrong with that request. Please try again.