aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-07-26 17:33:18 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-07-27 09:00:00 +0100
commitcace286e2d92ad50c4253c5765055e9da4da3871 (patch)
treeee46aafe1905ca6ca7e9fa4c145f2363904f1559 /spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
parent000b14b71c9dfb7b545240d8ca7ac19cae424a99 (diff)
include "locale" in list of session data keys that are used to decide if a rails session cookie is redundant for the purposes of this request. Fixes #91
Diffstat (limited to 'spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb')
-rw-r--r--spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb b/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
index cbe1feea6..1d71d680f 100644
--- a/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
+++ b/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
@@ -43,6 +43,14 @@ describe WhatDoTheyKnow::StripEmptySessions do
response.headers['Set-Cookie'].should == ""
end
+ it 'should strip the session cookie setting header even with a locale' do
+ @session_data[:locale] = 'en'
+ application_response_headers = { 'Content-Type' => 'text/html',
+ 'Set-Cookie' => 'mykey=f274c61a35320c52d45e9f8d7d4e2649; path=/; HttpOnly'}
+ response = make_response(@session_data, application_response_headers)
+ response.headers['Set-Cookie'].should == ""
+ end
+
it 'should strip the session cookie setting header (but no other cookie setting header) if there is more than one' do
application_response_headers = { 'Content-Type' => 'text/html',
'Set-Cookie' => ['mykey=f274c61a35320c52d45e9f8d7d4e2649; path=/; HttpOnly',