Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Made changes to allow absolute urls to be used #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/jasmine-jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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_
Expand All @@ -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
Expand Down