diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/utils_test.coffee | 10 | 
1 files changed, 4 insertions, 6 deletions
| diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee index 7439ddf7..0d1eeae2 100644 --- a/tests/unit_tests/utils_test.coffee +++ b/tests/unit_tests/utils_test.coffee @@ -50,6 +50,10 @@ context "convertToUrl",      assert.equal "https://www.google.com/search?q=go+ogle.com", Utils.convertToUrl("go ogle.com")      assert.equal "https://www.google.com/search?q=%40twitter", Utils.convertToUrl("@twitter") +context "createSearchUrl", +  should "replace %S without encoding", -> +    assert.equal "https://www.github.com/philc/vimium/pulls", Utils.createSearchUrl "vimium/pulls", "https://www.github.com/philc/%S" +  context "extractQuery",    should "extract queries from search URLs", ->      assert.equal "bbc sport 1", Utils.extractQuery "https://www.google.ie/search?q=%s", "https://www.google.ie/search?q=bbc+sport+1" @@ -57,12 +61,6 @@ context "extractQuery",      assert.equal "bbc sport 3", Utils.extractQuery "https://www.google.ie/search?q=%s", "http://www.google.ie/search?q=bbc+sport+3"      assert.equal "bbc sport 4", Utils.extractQuery "https://www.google.ie/search?q=%s", "http://www.google.ie/search?q=bbc+sport+4&blah" -  should "replace %S without encoding", -> -    assert.equal "vimium/pulls", Utils.extractQuery "https://www.github.com/philc/%S", "https://www.github.com/philc/vimium/pulls" - -  should "extract not queries from incorrect search URLs", -> -    assert.isFalse Utils.extractQuery "https://www.google.ie/search?q=%s&foo=bar", "https://www.google.ie/search?q=bbc+sport" -  context "hasChromePrefix",    should "detect chrome prefixes of URLs", ->      assert.isTrue Utils.hasChromePrefix "about:foobar" | 
