From 6c131beda7470290b1d95757d64f559ddb8948b0 Mon Sep 17 00:00:00 2001 From: slackersoft Date: Tue, 16 Dec 2014 17:21:22 -0800 Subject: [PATCH] Don't double escape focus spec links. - QueryString already escapes parameter values, no need to escape when passing them in from HtmlReporter. [finish #29578495] --- lib/jasmine-core/jasmine-html.js | 2 +- spec/html/HtmlReporterSpec.js | 6 +++--- src/html/HtmlReporter.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index e4f63edc..6f6c4cce 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -307,7 +307,7 @@ jasmineRequire.HtmlReporter = function(j$) { } function specHref(result) { - return addToExistingQueryString('spec', encodeURIComponent(result.fullName)); + return addToExistingQueryString('spec', result.fullName); } function defaultQueryString(key, value) { diff --git a/spec/html/HtmlReporterSpec.js b/spec/html/HtmlReporterSpec.js index 09a52161..0d1054ec 100644 --- a/spec/html/HtmlReporterSpec.js +++ b/spec/html/HtmlReporterSpec.js @@ -351,7 +351,7 @@ describe("New HtmlReporter", function() { var suiteDetail = outerSuite.childNodes[0]; var suiteLink = suiteDetail.childNodes[0]; expect(suiteLink.innerHTML).toEqual("A Suite"); - expect(suiteLink.getAttribute('href')).toEqual("?foo=bar&spec=A%20Suite"); + expect(suiteLink.getAttribute('href')).toEqual("?foo=bar&spec=A Suite"); var specs = outerSuite.childNodes[1]; var spec = specs.childNodes[0]; @@ -360,7 +360,7 @@ describe("New HtmlReporter", function() { var specLink = spec.childNodes[0]; expect(specLink.innerHTML).toEqual("with a spec"); - expect(specLink.getAttribute("href")).toEqual("?foo=bar&spec=A%20Suite%20with%20a%20spec"); + expect(specLink.getAttribute("href")).toEqual("?foo=bar&spec=A Suite with a spec"); // expect(specLink.getAttribute("title")).toEqual("A Suite with a spec"); }); @@ -616,7 +616,7 @@ describe("New HtmlReporter", function() { var specLink = specDiv.childNodes[0]; expect(specLink.getAttribute("title")).toEqual("a suite with a failing spec"); - expect(specLink.getAttribute("href")).toEqual("?foo=bar&spec=a%20suite%20with%20a%20failing%20spec"); + expect(specLink.getAttribute("href")).toEqual("?foo=bar&spec=a suite with a failing spec"); var message = failure.childNodes[1].childNodes[0]; expect(message.getAttribute("class")).toEqual("result-message"); diff --git a/src/html/HtmlReporter.js b/src/html/HtmlReporter.js index c96b8583..e49f83b4 100644 --- a/src/html/HtmlReporter.js +++ b/src/html/HtmlReporter.js @@ -278,7 +278,7 @@ jasmineRequire.HtmlReporter = function(j$) { } function specHref(result) { - return addToExistingQueryString('spec', encodeURIComponent(result.fullName)); + return addToExistingQueryString('spec', result.fullName); } function defaultQueryString(key, value) {