mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Remove Discourse.transient. Use a singleton for session data, it's a lot cleaner.
This commit is contained in:
16
test/javascripts/models/session_test.js
Normal file
16
test/javascripts/models/session_test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
module("Discourse.Session");
|
||||
|
||||
test('current', function(){
|
||||
var session = Discourse.Session.current();
|
||||
|
||||
present(session, "We have a current site session");
|
||||
equal(session, Discourse.Session.current(), "Calling it a second time returns the same instance");
|
||||
|
||||
blank(Discourse.Session.current('orange'), "by default properties are nil");
|
||||
session.set('orange', 'newBlack');
|
||||
equal(Discourse.Session.current('orange'), "newBlack", "it remembers values");
|
||||
|
||||
Discourse.Session.current('orange', 'juice');
|
||||
equal(session.get('orange'), "juice", "it can be updated");
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user