diff options
author | Azul <azul@riseup.net> | 2016-03-24 14:14:18 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-05-02 08:28:44 -0300 |
commit | 4bfbeedd9cf5f0f2a4b364764afd9c6acdc7399f (patch) | |
tree | 73179bde2951099510f6f99138192378cd4d543a /vendor/gems/couchrest_session_store/test/session_document_test.rb | |
parent | 5d18e8c396181ee8fab3f8579bc19abaee106d52 (diff) |
upgrade: separate CouchRest::Session from Document
CouchRest::Session now offers the high leven API while
CouchRest::Session::Document only extends the CouchRest::Document
to have the properties (rotation, naming, etc...) that we want.
A Session has a Session::Document instead of inheriting from it.
Diffstat (limited to 'vendor/gems/couchrest_session_store/test/session_document_test.rb')
-rw-r--r-- | vendor/gems/couchrest_session_store/test/session_document_test.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vendor/gems/couchrest_session_store/test/session_document_test.rb b/vendor/gems/couchrest_session_store/test/session_document_test.rb index 2125d10..43fbbca 100644 --- a/vendor/gems/couchrest_session_store/test/session_document_test.rb +++ b/vendor/gems/couchrest_session_store/test/session_document_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.dirname(__FILE__) + '/test_helper') +require_relative 'test_helper' class SessionDocumentTest < MiniTest::Test @@ -6,22 +6,22 @@ class SessionDocumentTest < MiniTest::Test sid = '1234' session = {'a' => 'b'} options = {} - doc = CouchRest::Session::Document.build_or_update(sid, session, options) - doc.save - doc.fetch(sid) - assert_equal session, doc.to_session + couchrest_session = CouchRest::Session.build_or_update(sid, session, options) + couchrest_session.save + couchrest_session.fetch(sid) + assert_equal session, couchrest_session.to_session end def test_storing_session_with_conflict sid = '1234' session = {'a' => 'b'} options = {} - doc = CouchRest::Session::Document.build_or_update(sid, session, options) - doc2 = CouchRest::Session::Document.build_or_update(sid, session, options) - doc.save - doc2.save - doc2.fetch(sid) - assert_equal session, doc2.to_session + cr_session = CouchRest::Session.build_or_update(sid, session, options) + cr_session2 = CouchRest::Session.build_or_update(sid, session, options) + cr_session.save + cr_session2.save + cr_session2.fetch(sid) + assert_equal session, cr_session2.to_session end end |