TITLE YET BUT IT’S ABOUT BACKBONE.JS This area is intentionally left mostly blank for the benefit of those sitting at the back. • @ rstacruz ricostacruz.com
test example scenario “Should be able to login” do visit “/login” fill_in :username, “sean_mcnamara” fill_in :password, “Kimber00” click_button “Sign in” assert page.has?(“Welcome, Sean!”) end RUBY + CAPYBARA
test example RUBY + CAPYBARA scenario “Should be able to login” do visit “/login” fill_in :username, “sean_mcnamara” fill_in :password, “Kimber00” click_button “Sign in” assert page.has?(“Welcome, Sean!”) end
function() { it(“should validate email addresses”, function() { var u = new User({ email: “bad_email@” }); var result = u.save(); // Our validation should prevent saving: expect(result).toBeFalse(); } }); Unit test example JASMINE.JS
function() { it(“should validate email addresses”, function() { var u = new User({ email: “bad_email@” }); var result = u.save(); // Our validation should prevent saving: expect(result).toBeFalse(); } }); Unit test example JASMINE.JS
Node and the Browser it("The 'toBe' matcher compares with ===", function() { var a = 12; var b = a; assert.equal(a, b); assert.notEqual(a, null); }); Do a console demo here!
mocha js test framework rubygems.org/gems/jasminerice jasmine integration for rails backbonejs.org official website underscorejs.org grab-bag of javascript goodness todomvc.com to do list apps implemented in mv* gruntjs.com command-line javascript build tool phantomjs.org headless webkit DEFYING GRAVITY WITH BACKBONE.JS References
require.js amd loader backbonejs.org official website jquery.com the wonderful query ricostacruz.com/backbone-patterns mini-book on common BB patterns js2coffee.org javascript to coffeescript compiler flickr.com has lots of cool photos and stuff DEFYING GRAVITY WITH BACKBONE.JS References