Add test_get_and_set() to stream_data tests

(imported from commit 007486f08879ea8b98524a91ef3fc02565cc4d86)
This commit is contained in:
Steve Howell 2013-08-22 23:29:41 -04:00
parent bf0909a94d
commit ca5cf073f4
1 changed files with 11 additions and 0 deletions

View File

@ -44,3 +44,14 @@ var stream_data = require('js/stream_data.js');
assert.equal(stream_data.get_name('denMARK'), 'Denmark');
assert.equal(stream_data.get_name('unknown Stream'), 'unknown Stream');
}());
(function test_get_and_set() {
stream_data.clear_subscriptions();
stream_data.add_sub('Denmark', {name: 'Denmark', subscribed: true});
assert.deepEqual(stream_data.subscribed_streams(), ['Denmark']);
var info = stream_data.get_stream_info();
stream_data.clear_subscriptions();
assert.deepEqual(stream_data.subscribed_streams(), []);
stream_data.set_stream_info(info);
assert.deepEqual(stream_data.subscribed_streams(), ['Denmark']);
}());