From 9d8646b0d1bee2ca60bbb7b494b63ab83e243072 Mon Sep 17 00:00:00 2001 From: Andres Ornelas Date: Wed, 30 Jun 2010 09:51:54 -0700 Subject: all tests passing with new futures concept --- test/scenario/DSLSpec.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'test/scenario/DSLSpec.js') diff --git a/test/scenario/DSLSpec.js b/test/scenario/DSLSpec.js index 5aac9752..442178d0 100644 --- a/test/scenario/DSLSpec.js +++ b/test/scenario/DSLSpec.js @@ -1,22 +1,22 @@ describe("DSL", function() { - var lastStep, executeStep, lastDocument; + var lastFuture, executeFuture, lastDocument; beforeEach(function() { - lastStep = null; + lastFuture = null; $scenario = { - addStep: function(name, stepFunction) { - lastStep = { name:name, fn: stepFunction}; + addFuture: function(name, behavior) { + lastFuture = { name:name, behavior: behavior}; } }; - executeStep = function(step, html, callback) { + executeFuture = function(future, html, callback) { lastDocument =_jQuery('
' + html + '
'); _jQuery(document.body).append(lastDocument); var specThis = { testWindow: window, testDocument: lastDocument }; - step.fn.call(specThis, callback || noop); + future.behavior.call(specThis, callback || noop); }; }); @@ -25,15 +25,15 @@ describe("DSL", function() { var input = angular.scenario.dsl.input; it('should enter', function() { input('name').enter('John'); - expect(lastStep.name).toEqual("Set input text of 'name' to 'John'"); - executeStep(lastStep, ''); + expect(lastFuture.name).toEqual("Set input text of 'name' to 'John'"); + executeFuture(lastFuture, ''); expect(lastDocument.find('input').val()).toEqual('John'); }); it('should select', function() { input('gender').select('female'); - expect(lastStep.name).toEqual("Select radio 'gender' to 'female'"); - executeStep(lastStep, + expect(lastFuture.name).toEqual("Select radio 'gender' to 'female'"); + executeFuture(lastFuture, '' + ''); expect(lastDocument.find(':radio:checked').length).toEqual(1); @@ -46,9 +46,9 @@ describe("DSL", function() { describe('repeater', function() { it('should check the count of repeated elements', function() { dslExpect.repeater('.repeater-row').count.toEqual(2); - expect(lastStep.name).toEqual("Expect that there are 2 items in Repeater with selector '.repeater-row'"); + expect(lastFuture.name).toEqual("Expect that there are 2 items in Repeater with selector '.repeater-row'"); var html = "
a
b
"; - executeStep(lastStep, html); + executeFuture(lastFuture, html); }); }); }); -- cgit v1.2.3