Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Created September 20, 2010 10:51
Show Gist options
  • Save omarqureshi/587728 to your computer and use it in GitHub Desktop.
Save omarqureshi/587728 to your computer and use it in GitHub Desktop.
diff --git a/actionpack/test/activerecord/active_record_store_test.rb b/actionpack/test/activerecord/active_record_store_test.rb
index 6f2fe32..98678d7 100644
--- a/actionpack/test/activerecord/active_record_store_test.rb
+++ b/actionpack/test/activerecord/active_record_store_test.rb
@@ -31,7 +31,13 @@ class ActiveRecordStoreTest < ActionController::IntegrationTest
session[:foo] = "baz"
head :ok
end
-
+
+ def set_session_value_and_cookie
+ cookies["foo"] = "bar"
+ session[:foo] = "bar"
+ render :nothing => true
+ end
+
def rescue_action(e) raise end
end
@@ -194,6 +200,15 @@ class ActiveRecordStoreTest < ActionController::IntegrationTest
assert_equal session_id, cookies['_session_id']
end
end
+
+ def test_setting_session_value_and_cookie
+ with_test_route_set do
+ get '/set_session_value_and_cookie'
+ assert_response :success
+ assert !cookies["\n_session_id"]
+ assert_equal({"_session_id" => request.session_options[:id], "foo" => "bar"}, cookies)
+ end
+ end
private
def with_test_route_set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment