12 May '12, 4pm

Testing #JavaScript with #Jasmine

describe("CreditCard", function() { it("cleans number by removing spaces and dashes", function() { expect(CreditCard.cleanNumber("123 4-5")).toEqual("12345"); }); it("validates based on mod 10", function() { expect(CreditCard.validNumber("4111 1111-11111111")).toBeTruthy(); expect(CreditCard.validNumber("4111111111111121")).toBeFalsy(); }); it("validates when text field loses focus", function() { loadFixtures("order_form.html"); $("#card_number").validateCreditCardNumber(); $("#card_number").val("123"); $("#card_number").blur(); expect($("#card_number_error")).toHaveText("Invalid credit card number."); $("#card_number").val("4111 1111-11111111"); $("#card_number").blur(); expect($("#card_number_error")).toHaveText(""); }); });

Full article: http://railscasts.com/episodes/261-testing-javascript-wit...

Tweets

Reuse your JavaScript as jQuery Plugins | Engin...

engineyard.com 12 May '12, 10am

Our team finds that we get the greatest leverage out of our existing collection of code snippets by organizing them into w...

SPA - Another day of testing in Montmelo

ferrari.com 11 May '12, 3pm

This was the first day of practice for the Spanish Grand Prix, but, for Scuderia Ferrari at least, it felt more like the s...

SPA - Testing times in Spain

SPA - Testing times in Spain

ferrari.com 11 May '12, 4pm

Montmelo, 11 May – It’s fair to say that the Catalunya circuit has not always had good press from the 21 Grands Prix held ...

Porsche's 918 Super-Hybrid Caught Testing (spy pics).

Porsche's 918 Super-Hybrid Caught Testing (spy ...

gas2.org 12 May '12, 5pm

, Porsche showed the 78+ mpg, 200 mph 918 hybrid supercar to a world that believed hybrid = slow. Boring. Since then, Pors...

#32 Time in Text Field - RailsCasts

#32 Time in Text Field - RailsCasts

railscasts.com 12 May '12, 4am

Replacing the drop-downs with a text field will mean that we have a field on the form that doesn’t directly map on to a fi...

Watching Sass Basics on RailsCasts via @railscasts

railscasts.com 10 May '12, 10pm

$main-color: #1E7B12; @mixin rounded-corners($radius) { border-radius: $radius; -moz-border-radius: $radius; -webkit-borde...

Google Testing Semantic Search Update

searchenginejournal.com 10 May '12, 12pm

In March, Search Engine Journal reported that Google was planning on making drastic algorithmic changes to provide its use...