velesin/jasmine-jquery — Issue #45: Loading fixture issue
Author: trivektor
Created: 2012-01-17 18:40:22+00:00
State: open

Hi,

I'm having some issue with loading fixture. Below is my code

$(function() {

beforeEach(function(){
loadFixtures("categories.html");

keywordsListView = new KeywordsListView({
el: $("#keywords_list")
})
})

it("should ...", function() {
expect(keywordsListView.el.attr("id")).toEqual("keywords_list");
})

})

For some reason keywordsListView.el is undefined even though the fixture file exists and #keywords_list exist in the file. However, if I have loadFixtures before "beforeEach" then everything works fine. In other words, this will work

$(function() {

loadFixtures(...)

beforeEach(function() {
loadFixtures(...)
})

})