From 9586ebb67e7a40472aef5c7cd2287f90ce818c8a Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Fri, 12 Nov 2010 16:44:22 -0600 Subject: [PATCH] specs for AspectEdit.onMovePersonSuccess --- spec/javascripts/aspect-edit-spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/javascripts/aspect-edit-spec.js b/spec/javascripts/aspect-edit-spec.js index 90df6813a..04ccbe06b 100644 --- a/spec/javascripts/aspect-edit-spec.js +++ b/spec/javascripts/aspect-edit-spec.js @@ -194,6 +194,16 @@ describe("AspectEdit", function() { }); }); + describe("onMovePersonSuccess", function() { + it("updates the data-aspect_id attribute on the person li", function() { + var person = $('li.person'); + var dropzone = $('.dropzone.ui-droppable[data-aspect_id="guid-of-target-aspect"]'); + expect(person.attr("data-aspect_id")).toEqual("guid-of-current-aspect"); + AspectEdit.onMovePersonSuccess(person, dropzone); + expect(person.attr("data-aspect_id")).toEqual("guid-of-target-aspect"); + }); + }); + describe("decrementRequestsCounter", function() { describe("when there is one request", function() { it("removes the counter from the new requests div", function() {