Permalink
Browse files

adding a test for session save

  • Loading branch information...
1 parent 30df88a commit 38734aff2005f1739ce7229db9d12363106f68c6 @tenderlove tenderlove committed Jul 22, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 activerecord/test/cases/session_store/sql_bypass.rb
View
10 activerecord/test/cases/session_store/sql_bypass.rb
@@ -32,6 +32,16 @@ def test_loaded?
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

0 comments on commit 38734af

Please sign in to comment.