jnicklas/evergreen — Issue #51: can't get access to variable in a template
Author: speedypin
Created: 2012-02-05 14:54:09+00:00
State: open

I have the following template:

¬

¬
¬

¬

¬

This is text 1

¬

¬
¬

and I want to be able to check the value of the item window.myVar. Here is my spec:

describe('initiating Tranzu', function() {
require('/assets/jquery.js');
template('sample_client_page.html');

it("should load the project id to be set correctly", function() {
expect( $('#p1') ).toBeDefined();
expect(window.myVar).toEqual( 123 );
});

});

Unfortunately, window.myVar is undefined. What am I doing wrong?