aboutsummaryrefslogtreecommitdiff
path: root/data/stuff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-04-01 15:58:08 -0400
committerPaul Duncan <pabs@pablotron.org>2016-04-01 15:58:08 -0400
commit6b9ca27c67d043a8737da652bf7915645628db4c (patch)
tree928ead16b4d04a695de6642c9dc818edab74b0d3 /data/stuff
parent974d7c1d8ae71d50566dc8c2857520dde139a191 (diff)
downloadold-guff-6b9ca27c67d043a8737da652bf7915645628db4c.tar.bz2
old-guff-6b9ca27c67d043a8737da652bf7915645628db4c.zip
add_user test
Diffstat (limited to 'data/stuff')
-rw-r--r--data/stuff/test/auth.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/data/stuff/test/auth.js b/data/stuff/test/auth.js
index 103be82..1bba095 100644
--- a/data/stuff/test/auth.js
+++ b/data/stuff/test/auth.js
@@ -88,6 +88,31 @@ jQuery(function($) {
return false;
});
+ $('#create-user').click(function() {
+ var me = $(this);
+
+ // toggle loading
+ me.toggleClass('disabled').find('.loading').toggleClass('hidden');
+
+ send('test/add_user', {
+ name: $('#user-name').val(),
+ active: 't',
+ email: $('#user-email').val(),
+ password: $('#user-password').val(),
+ role: $('#user-role').val(),
+ }).always(function() {
+ // toggle loading
+ me.toggleClass('disabled').find('.loading').toggleClass('hidden');
+ }).fail(function(r) {
+ alert('Error ' + r.responseText);
+ }).done(function(r) {
+ console.log(r);
+ });
+
+ // stop event
+ return false;
+ });
+
$('#reload').click(reload);
// load users