describe("autosubmit-plugin", function() {
    var pattern;

    requireDependencies(["patterns/autosubmit"], function(cls) {
        pattern = cls;
    });

    // Reset the lab before each test
    beforeEach(function() {
        $("#lab *").remove();
    });

    describe("parse", function() {
        it("Shorthand notation", function() {
            var $trigger = $("<input data-pat-autosubmit='500'/>");
                options = pattern.parse($trigger);
            expect(options.delay).toBe("500");
        });

        it("Multiple options not accepted", function() {
            var $trigger = $("<input data-pat-autosubmit='500 && 400'/>");
                options = pattern.parse($trigger);
            expect(options.delay).toBe("500");
        });
    });

    describe("validateOptions", function() {
        it("Integer delay", function() {
            var options = pattern.validateOptions({delay: 500});
            expect(options.delay).toBe(500);
        });

        it("String integer delay", function() {
            var options = pattern.validateOptions({delay: "500"});
            expect(options.delay).toBe(500);
        });

        it("Delay keyword", function() {
            var options = pattern.validateOptions({delay: "delay"});
            expect(options.delay).toBe(400);
        });

        it("Delay set to true", function() {
            var options = pattern.validateOptions({delay: "true"});
            expect(options.delay).toBe(400);
        });

        it("Invalid syntax", function() {
            var options = pattern.validateOptions({delay: "invalid"});
            expect(options).toBeFalsy();
        });

        it("Bad type", function() {
            var options = pattern.validateOptions({delay: [500]});
            expect(options).toBeFalsy();
        });

        it("Negative delay", function() {
            var options = pattern.validateOptions({delay: -500});
            expect(options).toBeFalsy();
        });

    });
});

// jshint indent: 4, browser: true, jquery: true, quotmark: double
// vim: sw=4 expandtab

@@ -804,32 +804,111 @@
 %22, function() %7B%0A
+        var defaultKeyupDelay = 400;  // as defined in patterns/autosubmit.js%0A%0A
         it(%22Inte
@@ -924,32 +924,32 @@
 %22, function() %7B%0A
-
             var 
@@ -1369,35 +1369,49 @@
 ons.delay).toBe(
-400
+defaultKeyupDelay
 );%0A        %7D);%0A%0A
@@ -1562,19 +1562,33 @@
 y).toBe(
-400
+defaultKeyupDelay
 );%0A     
@@ -1730,36 +1730,54 @@
 pect(options
-).toBeFalsy(
+.delay).toBe(defaultKeyupDelay
 );%0A        %7D
@@ -1905,36 +1905,54 @@
 pect(options
-).toBeFalsy(
+.delay).toBe(defaultKeyupDelay
 );%0A        %7D
@@ -2093,20 +2093,38 @@
 ions
-).toBeFalsy(
+.delay).toBe(defaultKeyupDelay
 );%0A 

Update validateOptions tests