[Libreoffice-commits] .: bug/bug
Rob Snelders
rsnelders at kemper.freedesktop.org
Fri Nov 23 08:52:29 PST 2012
bug/bug/bug.js | 10 +++++++---
bug/bug/test.js | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 1944a962db3153f87a9265e5bb932de14ff0e342
Author: Rob Snelders <programming at ertai.nl>
Date: Fri Nov 23 17:52:11 2012 +0100
Fixing the tests after the adding of the token-variable.
diff --git a/bug/bug/bug.js b/bug/bug/bug.js
index c6f5966..5bcad72 100644
--- a/bug/bug/bug.js
+++ b/bug/bug/bug.js
@@ -235,9 +235,12 @@
state_submit: function() {
var element = $('.state_submit');
if(!element.hasClass('initialized')) {
- $.bug.ajax('GET', $.bug.url + '/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED').pipe(function(data){
- $.bug.token = data.match(/<input type="hidden" name="token" value="([A-Za-z0-9]{10})">/)[1];
- });
+
+ if ($.bug.token == '') {
+ $.bug.ajax('GET', $.bug.url + '/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED').pipe(function(data){
+ $.bug.token = data.match(/<input type="hidden" name="token" value="([A-Za-z0-9]{10})">/)[1];
+ });
+ }
var form = $('.submission_form form');
$.bug.error_clear();
@@ -258,6 +261,7 @@
$('input[name="version"]', form).val(version);
$('input[name="short_desc"]', form).val(short_desc);
$('input[name="comment"]', form).val(comment);
+ $.bug.token = '';
return true;
});
diff --git a/bug/bug/test.js b/bug/bug/test.js
index f6a3e24..4b33c6b 100644
--- a/bug/bug/test.js
+++ b/bug/bug/test.js
@@ -238,6 +238,7 @@ test("state_submit", function() {
$.bug.state_success = function() { ok(true, 'state_success'); };
var element = $('.state_submit');
+ $.bug.token = 'AA';
equal(element.css('display'), 'none');
ok(!element.hasClass('initialized'), 'is not initialized');
$.bug.state_submit();
More information about the Libreoffice-commits
mailing list