From 16da29309cdb117e2ac40eb93286fc265c3135d5 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 23 Mar 2016 21:53:29 +0100 Subject: vendoring couchrest session store for development 0.4.0 has not been released yet. But travis needs it to run. So i vendor it for now. Will remove it again when the build is getting stable. --- .../test/session_document_test.rb | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vendor/gems/couchrest_session_store/test/session_document_test.rb (limited to 'vendor/gems/couchrest_session_store/test/session_document_test.rb') diff --git a/vendor/gems/couchrest_session_store/test/session_document_test.rb b/vendor/gems/couchrest_session_store/test/session_document_test.rb new file mode 100644 index 0000000..2125d10 --- /dev/null +++ b/vendor/gems/couchrest_session_store/test/session_document_test.rb @@ -0,0 +1,27 @@ +require File.expand_path(File.dirname(__FILE__) + '/test_helper') + +class SessionDocumentTest < MiniTest::Test + + def test_storing_session + 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 + 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 + end + +end -- cgit v1.2.3