From a247bb7b9e813ffc06166b46c0460bc223ccc430 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Tue, 13 May 2014 12:57:22 -0400 Subject: [PATCH] Fix StaffDebug javascript tests --- .../js/spec/staff_debug_actions_spec.js | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lms/static/js/spec/staff_debug_actions_spec.js b/lms/static/js/spec/staff_debug_actions_spec.js index 347dd6d584..9e415da762 100644 --- a/lms/static/js/spec/staff_debug_actions_spec.js +++ b/lms/static/js/spec/staff_debug_actions_spec.js @@ -1,6 +1,7 @@ describe('StaffDebugActions', function() { - var loc = 'test_loc'; - var fixture_id = 'sd_fu_' + loc; + var location = 'i4x://edX/Open_DemoX/edx_demo_course/problem/test_loc'; + var locationName = 'test_loc' + var fixture_id = 'sd_fu_' + locationName; var fixture = $('', { id: fixture_id, placeholder: "userman" }); describe('get_url ', function() { @@ -14,13 +15,13 @@ describe('StaffDebugActions', function() { it('gets the placeholder username if input field is empty', function() { $('body').append(fixture); - expect(StaffDebug.get_user(loc)).toBe('userman'); + expect(StaffDebug.get_user(locationName)).toBe('userman'); $('#' + fixture_id).remove(); }); it('gets a filled in name if there is one', function() { $('body').append(fixture); $('#' + fixture_id).val('notuserman'); - expect(StaffDebug.get_user(loc)).toBe('notuserman'); + expect(StaffDebug.get_user(locationName)).toBe('notuserman'); $('#' + fixture_id).val(''); $('#' + fixture_id).remove(); @@ -31,11 +32,11 @@ describe('StaffDebugActions', function() { $('body').append(fixture); spyOn($, 'ajax'); - StaffDebug.reset(loc); + StaffDebug.reset(locationName, location); expect($.ajax.mostRecentCall.args[0]['type']).toEqual('GET'); expect($.ajax.mostRecentCall.args[0]['data']).toEqual({ - 'problem_to_reset': loc, + 'problem_to_reset': location, 'unique_student_identifier': 'userman', 'delete_module': false }); @@ -50,11 +51,11 @@ describe('StaffDebugActions', function() { $('body').append(fixture); spyOn($, 'ajax'); - StaffDebug.sdelete(loc); + StaffDebug.sdelete(locationName, location); expect($.ajax.mostRecentCall.args[0]['type']).toEqual('GET'); expect($.ajax.mostRecentCall.args[0]['data']).toEqual({ - 'problem_to_reset': loc, + 'problem_to_reset': location, 'unique_student_identifier': 'userman', 'delete_module': true }); @@ -70,11 +71,11 @@ describe('StaffDebugActions', function() { $('body').append(fixture); spyOn($, 'ajax'); - StaffDebug.rescore(loc); + StaffDebug.rescore(locationName, location); expect($.ajax.mostRecentCall.args[0]['type']).toEqual('GET'); expect($.ajax.mostRecentCall.args[0]['data']).toEqual({ - 'problem_to_reset': loc, + 'problem_to_reset': location, 'unique_student_identifier': 'userman', 'delete_module': false });