aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit_tests/settings_test.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-12-30 16:14:23 +0000
committerStephen Blott2014-12-30 16:14:23 +0000
commit214ecb92caa8fc5a71dd3cac70a7280e1de08ccd (patch)
treebd8312058bd452828dd405d481caae7f8a7f00c3 /tests/unit_tests/settings_test.coffee
parent8f998f5b4cd1d8600b62ae7faac8afb91c4d2dab (diff)
parent74b5c1a9bb54bbc2a2c9d30925d514e02a5515f7 (diff)
downloadvimium-214ecb92caa8fc5a71dd3cac70a7280e1de08ccd.tar.bz2
Merge branch 'search-engine-descriptions' of https://github.com/smblott-github/vimium into smblott-github-search-engine-descriptions
Diffstat (limited to 'tests/unit_tests/settings_test.coffee')
-rw-r--r--tests/unit_tests/settings_test.coffee13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee
index 4625457b..afe862a4 100644
--- a/tests/unit_tests/settings_test.coffee
+++ b/tests/unit_tests/settings_test.coffee
@@ -70,14 +70,15 @@ context "settings",
chrome.storage.sync.set { scrollStepSize: JSON.stringify(message) }
assert.equal message, Sync.message
- should "set search engines, retrieve them correctly and check that it has been parsed correctly", ->
- searchEngines = "foo: bar?q=%s\n# comment\nbaz: qux?q=%s"
- parsedSearchEngines = {"foo": "bar?q=%s", "baz": "qux?q=%s"}
+ should "set search engines, retrieve them correctly and check that they have been parsed correctly", ->
+ searchEngines = "foo: bar?q=%s\n# comment\nbaz: qux?q=%s baz description"
Settings.set 'searchEngines', searchEngines
- assert.equal(searchEngines, Settings.get('searchEngines'))
result = Settings.getSearchEngines()
- assert.isTrue(parsedSearchEngines["foo"] == result["foo"] &&
- parsedSearchEngines["baz"] == result["baz"] && Object.keys(result).length == 2)
+ assert.equal Object.keys(result).length, 2
+ assert.equal "bar?q=%s", result["foo"].url
+ assert.isFalse result["foo"].description
+ assert.equal "qux?q=%s", result["baz"].url
+ assert.equal "baz description", result["baz"].description
should "sync a key which is not a known setting (without crashing)", ->
chrome.storage.sync.set { notASetting: JSON.stringify("notAUsefullValue") }