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