From 599315f64d75db1cba24ba759750e94c24d76f1f Mon Sep 17 00:00:00 2001 From: Nicholas Murray Date: Fri, 24 Apr 2015 18:31:20 +0100 Subject: [PATCH] Made cheanges to allow absolute urls to be used --- lib/jasmine-jquery.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/jasmine-jquery.js b/lib/jasmine-jquery.js index 44953412..7299edaa 100644 --- a/lib/jasmine-jquery.js +++ b/lib/jasmine-jquery.js @@ -154,6 +154,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. } jasmine.Fixtures.prototype.makeFixtureUrl_ = function (relativeUrl){ + if (this.fixturesPath === '') { + return relativeUrl + } return this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl } @@ -220,6 +223,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. this.fixturesPath = 'spec/javascripts/fixtures/json' } + jasmine.JSONFixtures.prototype.makeFixtureUrl_ = jasmine.Fixtures.prototype.makeFixtureUrl_ + jasmine.JSONFixtures.prototype.load = function () { this.read.apply(this, arguments) return this.fixturesCache_ @@ -246,7 +251,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jasmine.JSONFixtures.prototype.loadFixtureIntoCache_ = function (relativeUrl) { var self = this - , url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl + , url = this.makeFixtureUrl_(relativeUrl) $.ajax({ async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded