From 6c6994e61d0f6b29b5dcc3fda0f8af77f9a5b8e9 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 3 Nov 2011 20:48:12 -0400 Subject: Fixes #4051 - fixes security token unit test and language unit tests --- js/tests/ElggLanguagesTest.js | 2 +- js/tests/ElggSecurityTest.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/tests/ElggLanguagesTest.js b/js/tests/ElggLanguagesTest.js index 1f66fc35b..9186ff5bb 100644 --- a/js/tests/ElggLanguagesTest.js +++ b/js/tests/ElggLanguagesTest.js @@ -6,7 +6,7 @@ ElggLanguagesTest.prototype.setUp = function() { //Immediately execute some dummy "returned" javascript instead of sending //an actual ajax request $.ajax = function(settings) { - var lang = settings.data.js.split('/')[1]; + var lang = settings.data.language; elgg.config.translations[lang] = {'language':lang}; }; }; diff --git a/js/tests/ElggSecurityTest.js b/js/tests/ElggSecurityTest.js index f1111168f..c7309d55f 100644 --- a/js/tests/ElggSecurityTest.js +++ b/js/tests/ElggSecurityTest.js @@ -31,10 +31,10 @@ ElggSecurityTest.prototype.testAddTokenAcceptsString = function() { str = "__elgg_ts=" + this.ts + "&__elgg_token=" + this.token; input = ""; - assertEquals(str, elgg.security.addToken(input)); + assertEquals('?' + str, elgg.security.addToken(input)); - input = "data=sofar"; - assertEquals(input+'&'+str, elgg.security.addToken(input)); + input = "?data=sofar"; + assertEquals(input + '&' + str, elgg.security.addToken(input)); }; -- cgit v1.2.3