<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/fake_application/app/controllers/tattle_controller.rb</filename>
    </added>
    <added>
      <filename>test/fake_application/app/views/tattle/read_tell.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,10 +1,12 @@
+* [#81] Fixed sessions working with redirects in testing
 * [#76] Move mack_ring_server to mack-distributed
 * [#75] Left over mack-distributed rake tasks
-* [#8]  Move distributed code from mack-core to mack-more
 * [#74] Added optional feature to disable initialization logging.
 * [#73] Tests no longer use the functional/unit directories
 * [#69] Added ViewHelperGenerator and ControllerHelperGenerator
 * [#25] Added ControllerGenerator
+* [#8]  Move distributed code from mack-core to mack-more
+* [#5] Added tell messaging
 * gem: genosaurus 1.2.2
 
 ===0.6.1.1</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module Mack
       
       def start(request, response, cookies)
         if app_config.mack.use_sessions
-          sess_id = cookies[app_config.mack.session_id]
+          sess_id = retrieve_session_id(request, response, cookies)
           unless sess_id
             sess_id = create_new_session(request, response, cookies)
           else
@@ -23,10 +23,17 @@ module Mack
       end
       
       def complete(request, response, cookies)
+        unless response.redirection?
+          request.session[:tell] = nil
+        end
         Cachetastic::Caches::MackSessionCache.set(sess_id, request.session) if app_config.mack.use_sessions
       end
       
       private
+      def retrieve_session_id(request, response, cookies)
+        cookies[app_config.mack.session_id]
+      end
+      
       def create_new_session(request, response, cookies)
         id = String.randomize(40).downcase
         cookies[app_config.mack.session_id] = {:value =&gt; id, :expires =&gt; nil}</diff>
      <filename>lib/mack/runner_helpers/session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,18 @@
 require &quot;test/unit&quot;
 
+#--
+module Mack
+  module RunnerHelpers # :nodoc:
+    class Session
+      private
+      def retrieve_session_id(request, response, cookies)
+        $current_session_id
+      end
+    end # Session
+  end # RunnerHelpers
+end # Mack
+#++
+
 module Mack
   module Testing # :nodoc:
     module Helpers
@@ -95,11 +108,12 @@ module Mack
     
       # Returns a Mack::Session from the request.
       def session # :nodoc:
-        Cachetastic::Caches::MackSessionCache.get(cookies[app_config.mack.session_id]) do
+        Cachetastic::Caches::MackSessionCache.get($current_session_id) do
           id = String.randomize(40).downcase
           set_cookie(app_config.mack.session_id, id)
           sess = Mack::Session.new(id)
           Cachetastic::Caches::MackSessionCache.set(id, sess)
+          $current_session_id = id
           sess
         end
       end
@@ -108,7 +122,9 @@ module Mack
       def in_session
         @_mack_in_session = true
         clear_session
+        $current_session_id = session.id
         yield
+        $current_session_id = nil
         clear_session
         @_mack_in_session = false
       end
@@ -169,6 +185,7 @@ module Mack
       def strip_cookies_from_response(res)
         unless res.original_headers[&quot;Set-Cookie&quot;].nil?
           res.original_headers[&quot;Set-Cookie&quot;].each do |ck|
+            puts &quot;ck: #{ck}&quot;
             spt = ck.split(&quot;=&quot;)
             name = spt.first
             value = spt.last</diff>
      <filename>lib/mack/testing/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,12 @@ Mack::Routes.build do |r|
 
   r.resource &quot;admin/users&quot;
   
+  r.with_options(:controller =&gt; :tattle) do |map|
+    map.set_tell &quot;/tattle/set_tell&quot;, :action =&gt; :set_tell
+    map.set_tell_and_redirect &quot;/tattle/set_tell_and_redirect&quot;, :action =&gt; :set_tell_and_redirect
+    map.read_tell &quot;/tattle/read_tell&quot;, :action =&gt; :read_tell
+  end
+  
   r.with_options(:controller =&gt; :tst_home_page) do |map|
     map.connect &quot;/&quot;
     map.connect &quot;foo&quot;, :action =&gt; :foo</diff>
      <filename>test/fake_application/config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,22 @@ require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
 describe Mack::Controller::Tell do
   include Mack::Controller::Tell
   
-  it &quot;should be settable in a controller&quot;
-  
-  it &quot;should be readable in a view&quot;
-  
-  it &quot;should persist until the next non-redirected action&quot;
+  it &quot;should be settable in a controller and readable in a view&quot; do
+    session[:tell].should be_nil
+    get set_tell_url(:say =&gt; &quot;hello good looking&quot;)
+    response.should be_successful
+    response.body.should match(/Someone wanted to say: 'hello good looking'/)
+    session[:tell].should be_nil
+  end
   
-  it &quot;should behave like a Hash&quot;
+  it &quot;should be persist through a redirect&quot; do
+    session[:tell].should be_nil
+    get set_tell_and_redirect_url(:say =&gt; &quot;what up?&quot;)
+    response.should be_redirect
+    response.should be_redirected_to(read_tell_url)
+    response.body.should match(/Someone wanted to say: 'what up\?'/)
+    session[:tell].should be_nil
+  end
   
   it &quot;should get set to an empty Hash in the Session if it's nil&quot; do
     session[:tell].should be_nil</diff>
      <filename>test/unit/controller/tell_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2484372bd61049f586d29aba3fd93db05303a5bc</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack/commit/88430a20db7fa50e18433d2719154a4c4666bfd0</url>
  <id>88430a20db7fa50e18433d2719154a4c4666bfd0</id>
  <committed-date>2008-08-07T11:11:01-07:00</committed-date>
  <authored-date>2008-08-07T11:11:01-07:00</authored-date>
  <message>Feature: Tell Messaging [#5 state:resolved]
Fixed: Sessions in testing [#81 state:resolved]</message>
  <tree>115382e56e9de92d79735bb32b402a5b6bbc1b70</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
