aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-22 09:35:50 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-22 09:35:50 -0700
commit38734aff2005f1739ce7229db9d12363106f68c6 (patch)
treefbe28a354827f7e7764f1e51e298872796f42fee /activerecord
parent30df88ae06182a72ae7f959dce8d8df4a7adb99a (diff)
downloadrails-38734aff2005f1739ce7229db9d12363106f68c6.tar.gz
rails-38734aff2005f1739ce7229db9d12363106f68c6.tar.bz2
rails-38734aff2005f1739ce7229db9d12363106f68c6.zip
adding a test for session save
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/session_store/sql_bypass.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/session_store/sql_bypass.rb b/activerecord/test/cases/session_store/sql_bypass.rb
index 6c4a70b9fe..0059467bc0 100644
--- a/activerecord/test/cases/session_store/sql_bypass.rb
+++ b/activerecord/test/cases/session_store/sql_bypass.rb
@@ -32,6 +32,16 @@ module ActiveRecord
s = SqlBypass.new :data => 'hello'
assert s.loaded?, 'it is loaded'
end
+
+ def test_save
+ SqlBypass.create_table! unless Session.table_exists?
+ session_id = 20
+ s = SqlBypass.new :data => 'hello', :session_id => session_id
+ s.save
+ t = SqlBypass.find_by_session_id session_id
+ assert_equal s.session_id, t.session_id
+ assert_equal s.data, t.data
+ end
end
end
end