From b8c501ee2e4f85ef8307ec27f39ea98fe0779a6c Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 19 Apr 2014 11:07:30 +0100 Subject: Test that all stored settings are JSONified. --- tests/unit_tests/settings_test.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee index 4b6f3498..5d24c7f2 100644 --- a/tests/unit_tests/settings_test.coffee +++ b/tests/unit_tests/settings_test.coffee @@ -13,6 +13,10 @@ context "settings", setup -> stub global, 'localStorage', {} + should "all settings stored in localStorage must be JSONified strings", -> + Settings.set 'dummy', "" + assert.equal localStorage.dummy, '""' + should "obtain defaults if no key is stored", -> assert.isFalse Settings.has 'scrollStepSize' assert.equal Settings.get('scrollStepSize'), 60 -- cgit v1.2.3