Create a gist now

Instantly share code, notes, and snippets.

test-driving backbone views with jquery templates
NutShell = Backbone.View.extend({
initialize: function(){
// road block!
this.template = $("#some-template-id");
<script id="some-template-id" type="text/x-jquery-tmpl">
<h1>some template {{name}}</h1>
<div id="foo">
and stuff here. {{description}}
describe("a test with a fixture", function(){
// load my template for use in this spec!
it("...", function(){ /* ... */ });
<%= erb :'some-template-id' %>
jasmine.getFixtures().fixturesPath = '/views/';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment