diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-21 16:59:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-21 16:59:23 -0700 |
commit | a78547a9c66eeaa3dbf5e2612483ca172fb137e9 (patch) | |
tree | ed3b9bacd90c5401427480b0e740b13e28e19377 /activerecord/test/cases/session_store/sql_bypass.rb | |
parent | 87a319cd0c51cbc8f6bc8e3d11ab9e30a96ac628 (diff) | |
download | rails-a78547a9c66eeaa3dbf5e2612483ca172fb137e9.tar.gz rails-a78547a9c66eeaa3dbf5e2612483ca172fb137e9.tar.bz2 rails-a78547a9c66eeaa3dbf5e2612483ca172fb137e9.zip |
testing loaded? method and reducing funcalls
Diffstat (limited to 'activerecord/test/cases/session_store/sql_bypass.rb')
-rw-r--r-- | activerecord/test/cases/session_store/sql_bypass.rb | 10 |
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 cea5e4eabe..6c4a70b9fe 100644 --- a/activerecord/test/cases/session_store/sql_bypass.rb +++ b/activerecord/test/cases/session_store/sql_bypass.rb @@ -22,6 +22,16 @@ module ActiveRecord s = SqlBypass.new :data => 'foo', :session_id => 10 assert s.new_record?, 'this is a new record!' end + + def test_not_loaded? + s = SqlBypass.new({}) + assert !s.loaded?, 'it is not loaded' + end + + def test_loaded? + s = SqlBypass.new :data => 'hello' + assert s.loaded?, 'it is loaded' + end end end end |