kaui 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/kaui/account_emails_controller.rb +54 -0
- data/app/controllers/kaui/accounts_controller.rb +6 -0
- data/app/controllers/kaui/tag_definitions_controller.rb +10 -10
- data/app/controllers/kaui/tags_controller.rb +85 -0
- data/app/helpers/kaui/killbill_helper.rb +54 -0
- data/app/models/kaui/account.rb +4 -2
- data/app/models/kaui/account_email.rb +48 -0
- data/app/views/kaui/account_emails/_account_emails_table.html.erb +10 -0
- data/app/views/kaui/account_emails/_form.html.erb +33 -0
- data/app/views/kaui/account_emails/edit.html.erb +6 -0
- data/app/views/kaui/account_emails/new.html.erb +3 -0
- data/app/views/kaui/account_emails/show.html.erb +24 -0
- data/app/views/kaui/accounts/show.html.erb +5 -1
- data/app/views/kaui/tag_definitions/index.html.erb +1 -1
- data/app/views/kaui/tags/_form.html.erb +25 -0
- data/app/views/kaui/tags/edit.html.erb +6 -0
- data/app/views/kaui/tags/index.html.erb +25 -0
- data/app/views/kaui/tags/new.html.erb +5 -0
- data/app/views/kaui/tags/show.html.erb +15 -0
- data/config/routes.rb +3 -0
- data/lib/kaui/version.rb +1 -1
- data/test/dummy/log/development.log +52294 -1360
- data/test/dummy/log/test.log +94034 -2851
- data/test/dummy/test/fixtures/bill_cycle_days.yml +3 -0
- data/test/dummy/tmp/cache/assets/C94/4E0/sprockets%2Fea1476dc10a3348303f74d111f70441a +0 -0
- data/test/dummy/tmp/cache/assets/{D0E/370/sprockets%2F27630db2080819f67c8a0ed5e491b7cb → CAA/680/sprockets%2F3824d037523f650518fb22acab75559d} +0 -0
- data/test/dummy/tmp/cache/assets/CD0/9D0/sprockets%2F5c9508c21501c73fbe00473a09b1f5f4 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CDF/1F0/sprockets%2F76ac5628a0c4d1b976cb622ec4493751 +381 -0
- data/test/dummy/tmp/cache/assets/CEA/300/sprockets%2Fdf2ad5c9d0990441c2bf59883383d652 +0 -0
- data/test/dummy/tmp/cache/assets/{C8D/6D0/sprockets%2F0ce756f49d61795508c543a702955fc2 → CF7/710/sprockets%2F86d43448e1fc383cb6f3d752ef288882} +0 -0
- data/test/dummy/tmp/cache/assets/D17/DD0/sprockets%2F665455ecdc7609b23f4ecb366d86055a +9409 -0
- data/test/dummy/tmp/cache/assets/D32/200/sprockets%2Ffa467106e01bda5d6246baea72159d64 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D39/5E0/sprockets%2F59fd338be48a81a17a2a785cbd1612b4 +0 -0
- data/test/dummy/tmp/cache/assets/D44/170/sprockets%2Fac15571bce3f926a498da7cd09322d97 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D6C/710/sprockets%2F1765773caead06c0a6a19ea9de2453f7 +0 -0
- data/test/dummy/tmp/cache/assets/D76/910/sprockets%2Ff99b4bdc434e11e8634e6af62fe805e0 +0 -0
- data/test/dummy/tmp/cache/assets/{D4A/DD0/sprockets%2F0f813582283b7f56fd83fe3d52be7e2c → D9F/160/sprockets%2F510462e1ebd5dbb7ae20888b77f9bed2} +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E07/1E0/sprockets%2F5a3fe6e98fdf72bbe75c605e54ebc5b0 +9409 -0
- data/test/dummy/tmp/cache/assets/E20/230/sprockets%2F7d3b1348fdf74cf1b6ba2107fbbac5af +0 -0
- data/test/dummy/tmp/cache/assets/{DF1/1A0/sprockets%2F7f6b7bfea83401d3106b7fadac81ea4b → E22/F40/sprockets%2Faffacf2e6be325520bd3bfd2096b6dd4} +0 -0
- data/test/dummy/tmp/cache/assets/E24/9D0/sprockets%2Fb966ab0a50fda3c156fbad4d8ab73ef6 +381 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/functional/kaui/account_emails_controller_test.rb +51 -0
- data/test/functional/kaui/tag_definitions_controller_test.rb +5 -5
- data/test/functional/kaui/tags_controller_test.rb +51 -0
- data/test/test_helper.rb +5 -1
- metadata +39 -10
Binary file
|
Binary file
|
@@ -0,0 +1,381 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@created_atf1345257322.208:@expires_in0:@value"i?{"
|
2
|
+
class"ProcessedAsset"logical_path"jquery_ujs.js"
|
3
|
+
mtime"2012-08-14T09:37:41-07:00"lengthi�<"digest"%0ff3e5680ead3dadeee021c144835311"source"�<(function($, undefined) {
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Unobtrusive scripting adapter for jQuery
|
7
|
+
*
|
8
|
+
* Requires jQuery 1.6.0 or later.
|
9
|
+
* https://github.com/rails/jquery-ujs
|
10
|
+
|
11
|
+
* Uploading file using rails.js
|
12
|
+
* =============================
|
13
|
+
*
|
14
|
+
* By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
|
15
|
+
* in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
|
16
|
+
*
|
17
|
+
* The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
|
18
|
+
*
|
19
|
+
* Ex:
|
20
|
+
* $('form').live('ajax:aborted:file', function(event, elements){
|
21
|
+
* // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
|
22
|
+
* // Returning false in this handler tells rails.js to disallow standard form submission
|
23
|
+
* return false;
|
24
|
+
* });
|
25
|
+
*
|
26
|
+
* The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
|
27
|
+
*
|
28
|
+
* Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
|
29
|
+
* techniques like the iframe method to upload the file instead.
|
30
|
+
*
|
31
|
+
* Required fields in rails.js
|
32
|
+
* ===========================
|
33
|
+
*
|
34
|
+
* If any blank required inputs (required="required") are detected in the remote form, the whole form submission
|
35
|
+
* is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
|
36
|
+
*
|
37
|
+
* The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
|
38
|
+
*
|
39
|
+
* !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
|
40
|
+
* get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
|
41
|
+
*
|
42
|
+
* Ex:
|
43
|
+
* $('form').live('ajax:aborted:required', function(event, elements){
|
44
|
+
* // Returning false in this handler tells rails.js to submit the form anyway.
|
45
|
+
* // The blank required inputs are passed to this function in `elements`.
|
46
|
+
* return ! confirm("Would you like to submit the form with missing info?");
|
47
|
+
* });
|
48
|
+
*/
|
49
|
+
|
50
|
+
// Shorthand to make it a little easier to call public rails functions from within rails.js
|
51
|
+
var rails;
|
52
|
+
|
53
|
+
$.rails = rails = {
|
54
|
+
// Link elements bound by jquery-ujs
|
55
|
+
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
|
56
|
+
|
57
|
+
// Select elements bound by jquery-ujs
|
58
|
+
inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
|
59
|
+
|
60
|
+
// Form elements bound by jquery-ujs
|
61
|
+
formSubmitSelector: 'form',
|
62
|
+
|
63
|
+
// Form input elements bound by jquery-ujs
|
64
|
+
formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])',
|
65
|
+
|
66
|
+
// Form input elements disabled during form submission
|
67
|
+
disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
|
68
|
+
|
69
|
+
// Form input elements re-enabled after form submission
|
70
|
+
enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
|
71
|
+
|
72
|
+
// Form required input elements
|
73
|
+
requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
|
74
|
+
|
75
|
+
// Form file input elements
|
76
|
+
fileInputSelector: 'input:file',
|
77
|
+
|
78
|
+
// Link onClick disable selector with possible reenable after remote submission
|
79
|
+
linkDisableSelector: 'a[data-disable-with]',
|
80
|
+
|
81
|
+
// Make sure that every Ajax request sends the CSRF token
|
82
|
+
CSRFProtection: function(xhr) {
|
83
|
+
var token = $('meta[name="csrf-token"]').attr('content');
|
84
|
+
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
85
|
+
},
|
86
|
+
|
87
|
+
// Triggers an event on an element and returns false if the event result is false
|
88
|
+
fire: function(obj, name, data) {
|
89
|
+
var event = $.Event(name);
|
90
|
+
obj.trigger(event, data);
|
91
|
+
return event.result !== false;
|
92
|
+
},
|
93
|
+
|
94
|
+
// Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
|
95
|
+
confirm: function(message) {
|
96
|
+
return confirm(message);
|
97
|
+
},
|
98
|
+
|
99
|
+
// Default ajax function, may be overridden with custom function in $.rails.ajax
|
100
|
+
ajax: function(options) {
|
101
|
+
return $.ajax(options);
|
102
|
+
},
|
103
|
+
|
104
|
+
// Default way to get an element's href. May be overridden at $.rails.href.
|
105
|
+
href: function(element) {
|
106
|
+
return element.attr('href');
|
107
|
+
},
|
108
|
+
|
109
|
+
// Submits "remote" forms and links with ajax
|
110
|
+
handleRemote: function(element) {
|
111
|
+
var method, url, data, crossDomain, dataType, options;
|
112
|
+
|
113
|
+
if (rails.fire(element, 'ajax:before')) {
|
114
|
+
crossDomain = element.data('cross-domain') || null;
|
115
|
+
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
116
|
+
|
117
|
+
if (element.is('form')) {
|
118
|
+
method = element.attr('method');
|
119
|
+
url = element.attr('action');
|
120
|
+
data = element.serializeArray();
|
121
|
+
// memoized value from clicked submit button
|
122
|
+
var button = element.data('ujs:submit-button');
|
123
|
+
if (button) {
|
124
|
+
data.push(button);
|
125
|
+
element.data('ujs:submit-button', null);
|
126
|
+
}
|
127
|
+
} else if (element.is(rails.inputChangeSelector)) {
|
128
|
+
method = element.data('method');
|
129
|
+
url = element.data('url');
|
130
|
+
data = element.serialize();
|
131
|
+
if (element.data('params')) data = data + "&" + element.data('params');
|
132
|
+
} else {
|
133
|
+
method = element.data('method');
|
134
|
+
url = rails.href(element);
|
135
|
+
data = element.data('params') || null;
|
136
|
+
}
|
137
|
+
|
138
|
+
options = {
|
139
|
+
type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
|
140
|
+
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
141
|
+
beforeSend: function(xhr, settings) {
|
142
|
+
if (settings.dataType === undefined) {
|
143
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
144
|
+
}
|
145
|
+
return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
|
146
|
+
},
|
147
|
+
success: function(data, status, xhr) {
|
148
|
+
element.trigger('ajax:success', [data, status, xhr]);
|
149
|
+
},
|
150
|
+
complete: function(xhr, status) {
|
151
|
+
element.trigger('ajax:complete', [xhr, status]);
|
152
|
+
},
|
153
|
+
error: function(xhr, status, error) {
|
154
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
155
|
+
}
|
156
|
+
};
|
157
|
+
// Only pass url to `ajax` options if not blank
|
158
|
+
if (url) { options.url = url; }
|
159
|
+
|
160
|
+
return rails.ajax(options);
|
161
|
+
} else {
|
162
|
+
return false;
|
163
|
+
}
|
164
|
+
},
|
165
|
+
|
166
|
+
// Handles "data-method" on links such as:
|
167
|
+
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
168
|
+
handleMethod: function(link) {
|
169
|
+
var href = rails.href(link),
|
170
|
+
method = link.data('method'),
|
171
|
+
target = link.attr('target'),
|
172
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
173
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
174
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
175
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
176
|
+
|
177
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
178
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
179
|
+
}
|
180
|
+
|
181
|
+
if (target) { form.attr('target', target); }
|
182
|
+
|
183
|
+
form.hide().append(metadata_input).appendTo('body');
|
184
|
+
form.submit();
|
185
|
+
},
|
186
|
+
|
187
|
+
/* Disables form elements:
|
188
|
+
- Caches element value in 'ujs:enable-with' data store
|
189
|
+
- Replaces element text with value of 'data-disable-with' attribute
|
190
|
+
- Sets disabled property to true
|
191
|
+
*/
|
192
|
+
disableFormElements: function(form) {
|
193
|
+
form.find(rails.disableSelector).each(function() {
|
194
|
+
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
195
|
+
element.data('ujs:enable-with', element[method]());
|
196
|
+
element[method](element.data('disable-with'));
|
197
|
+
element.prop('disabled', true);
|
198
|
+
});
|
199
|
+
},
|
200
|
+
|
201
|
+
/* Re-enables disabled form elements:
|
202
|
+
- Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
|
203
|
+
- Sets disabled property to false
|
204
|
+
*/
|
205
|
+
enableFormElements: function(form) {
|
206
|
+
form.find(rails.enableSelector).each(function() {
|
207
|
+
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
208
|
+
if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
|
209
|
+
element.prop('disabled', false);
|
210
|
+
});
|
211
|
+
},
|
212
|
+
|
213
|
+
/* For 'data-confirm' attribute:
|
214
|
+
- Fires `confirm` event
|
215
|
+
- Shows the confirmation dialog
|
216
|
+
- Fires the `confirm:complete` event
|
217
|
+
|
218
|
+
Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
|
219
|
+
Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
|
220
|
+
Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
|
221
|
+
return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
|
222
|
+
*/
|
223
|
+
allowAction: function(element) {
|
224
|
+
var message = element.data('confirm'),
|
225
|
+
answer = false, callback;
|
226
|
+
if (!message) { return true; }
|
227
|
+
|
228
|
+
if (rails.fire(element, 'confirm')) {
|
229
|
+
answer = rails.confirm(message);
|
230
|
+
callback = rails.fire(element, 'confirm:complete', [answer]);
|
231
|
+
}
|
232
|
+
return answer && callback;
|
233
|
+
},
|
234
|
+
|
235
|
+
// Helper function which checks for blank inputs in a form that match the specified CSS selector
|
236
|
+
blankInputs: function(form, specifiedSelector, nonBlank) {
|
237
|
+
var inputs = $(), input,
|
238
|
+
selector = specifiedSelector || 'input,textarea';
|
239
|
+
form.find(selector).each(function() {
|
240
|
+
input = $(this);
|
241
|
+
// Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
|
242
|
+
if (nonBlank ? input.val() : !input.val()) {
|
243
|
+
inputs = inputs.add(input);
|
244
|
+
}
|
245
|
+
});
|
246
|
+
return inputs.length ? inputs : false;
|
247
|
+
},
|
248
|
+
|
249
|
+
// Helper function which checks for non-blank inputs in a form that match the specified CSS selector
|
250
|
+
nonBlankInputs: function(form, specifiedSelector) {
|
251
|
+
return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
|
252
|
+
},
|
253
|
+
|
254
|
+
// Helper function, needed to provide consistent behavior in IE
|
255
|
+
stopEverything: function(e) {
|
256
|
+
$(e.target).trigger('ujs:everythingStopped');
|
257
|
+
e.stopImmediatePropagation();
|
258
|
+
return false;
|
259
|
+
},
|
260
|
+
|
261
|
+
// find all the submit events directly bound to the form and
|
262
|
+
// manually invoke them. If anyone returns false then stop the loop
|
263
|
+
callFormSubmitBindings: function(form, event) {
|
264
|
+
var events = form.data('events'), continuePropagation = true;
|
265
|
+
if (events !== undefined && events['submit'] !== undefined) {
|
266
|
+
$.each(events['submit'], function(i, obj){
|
267
|
+
if (typeof obj.handler === 'function') return continuePropagation = obj.handler(event);
|
268
|
+
});
|
269
|
+
}
|
270
|
+
return continuePropagation;
|
271
|
+
},
|
272
|
+
|
273
|
+
// replace element's html with the 'data-disable-with' after storing original html
|
274
|
+
// and prevent clicking on it
|
275
|
+
disableElement: function(element) {
|
276
|
+
element.data('ujs:enable-with', element.html()); // store enabled state
|
277
|
+
element.html(element.data('disable-with')); // set to disabled state
|
278
|
+
element.bind('click.railsDisable', function(e) { // prevent further clicking
|
279
|
+
return rails.stopEverything(e)
|
280
|
+
});
|
281
|
+
},
|
282
|
+
|
283
|
+
// restore element to its original state which was disabled by 'disableElement' above
|
284
|
+
enableElement: function(element) {
|
285
|
+
if (element.data('ujs:enable-with') !== undefined) {
|
286
|
+
element.html(element.data('ujs:enable-with')); // set to old enabled state
|
287
|
+
// this should be element.removeData('ujs:enable-with')
|
288
|
+
// but, there is currently a bug in jquery which makes hyphenated data attributes not get removed
|
289
|
+
element.data('ujs:enable-with', false); // clean up cache
|
290
|
+
}
|
291
|
+
element.unbind('click.railsDisable'); // enable element
|
292
|
+
}
|
293
|
+
|
294
|
+
};
|
295
|
+
|
296
|
+
$.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
|
297
|
+
|
298
|
+
$(document).delegate(rails.linkDisableSelector, 'ajax:complete', function() {
|
299
|
+
rails.enableElement($(this));
|
300
|
+
});
|
301
|
+
|
302
|
+
$(document).delegate(rails.linkClickSelector, 'click.rails', function(e) {
|
303
|
+
var link = $(this), method = link.data('method'), data = link.data('params');
|
304
|
+
if (!rails.allowAction(link)) return rails.stopEverything(e);
|
305
|
+
|
306
|
+
if (link.is(rails.linkDisableSelector)) rails.disableElement(link);
|
307
|
+
|
308
|
+
if (link.data('remote') !== undefined) {
|
309
|
+
if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; }
|
310
|
+
|
311
|
+
if (rails.handleRemote(link) === false) { rails.enableElement(link); }
|
312
|
+
return false;
|
313
|
+
|
314
|
+
} else if (link.data('method')) {
|
315
|
+
rails.handleMethod(link);
|
316
|
+
return false;
|
317
|
+
}
|
318
|
+
});
|
319
|
+
|
320
|
+
$(document).delegate(rails.inputChangeSelector, 'change.rails', function(e) {
|
321
|
+
var link = $(this);
|
322
|
+
if (!rails.allowAction(link)) return rails.stopEverything(e);
|
323
|
+
|
324
|
+
rails.handleRemote(link);
|
325
|
+
return false;
|
326
|
+
});
|
327
|
+
|
328
|
+
$(document).delegate(rails.formSubmitSelector, 'submit.rails', function(e) {
|
329
|
+
var form = $(this),
|
330
|
+
remote = form.data('remote') !== undefined,
|
331
|
+
blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
|
332
|
+
nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
|
333
|
+
|
334
|
+
if (!rails.allowAction(form)) return rails.stopEverything(e);
|
335
|
+
|
336
|
+
// skip other logic when required values are missing or file upload is present
|
337
|
+
if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
|
338
|
+
return rails.stopEverything(e);
|
339
|
+
}
|
340
|
+
|
341
|
+
if (remote) {
|
342
|
+
if (nonBlankFileInputs) {
|
343
|
+
return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
|
344
|
+
}
|
345
|
+
|
346
|
+
// If browser does not support submit bubbling, then this live-binding will be called before direct
|
347
|
+
// bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
|
348
|
+
if (!$.support.submitBubbles && $().jquery < '1.7' && rails.callFormSubmitBindings(form, e) === false) return rails.stopEverything(e);
|
349
|
+
|
350
|
+
rails.handleRemote(form);
|
351
|
+
return false;
|
352
|
+
|
353
|
+
} else {
|
354
|
+
// slight timeout so that the submit button gets properly serialized
|
355
|
+
setTimeout(function(){ rails.disableFormElements(form); }, 13);
|
356
|
+
}
|
357
|
+
});
|
358
|
+
|
359
|
+
$(document).delegate(rails.formInputClickSelector, 'click.rails', function(event) {
|
360
|
+
var button = $(this);
|
361
|
+
|
362
|
+
if (!rails.allowAction(button)) return rails.stopEverything(event);
|
363
|
+
|
364
|
+
// register the pressed submit button
|
365
|
+
var name = button.attr('name'),
|
366
|
+
data = name ? {name:name, value:button.val()} : null;
|
367
|
+
|
368
|
+
button.closest('form').data('ujs:submit-button', data);
|
369
|
+
});
|
370
|
+
|
371
|
+
$(document).delegate(rails.formSubmitSelector, 'ajax:beforeSend.rails', function(event) {
|
372
|
+
if (this == event.target) rails.disableFormElements($(this));
|
373
|
+
});
|
374
|
+
|
375
|
+
$(document).delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) {
|
376
|
+
if (this == event.target) rails.enableFormElements($(this));
|
377
|
+
});
|
378
|
+
|
379
|
+
})( jQuery );
|
380
|
+
"dependency_digest"%2cd1d2f8ab16360cb1694393844f1d1f"required_paths["j/Users/pierre/.rvm/gems/jruby-1.6.7.2/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery_ujs.js"dependency_paths[{" path"j/Users/pierre/.rvm/gems/jruby-1.6.7.2/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery_ujs.js"
|
381
|
+
mtime"2012-08-14T09:37:41-07:00"digest"%0ff3e5680ead3dadeee021c144835311"
|
@@ -0,0 +1 @@
|
|
1
|
+
62796
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# require 'test_helper'
|
2
|
+
#
|
3
|
+
# module Kaui
|
4
|
+
# class AccountEmailsControllerTest < ActionController::TestCase
|
5
|
+
# setup do
|
6
|
+
# @account_email = account_emails(:one)
|
7
|
+
# end
|
8
|
+
#
|
9
|
+
# test "should get index" do
|
10
|
+
# get :index
|
11
|
+
# assert_response :success
|
12
|
+
# assert_not_nil assigns(:account_emails)
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# test "should get new" do
|
16
|
+
# get :new
|
17
|
+
# assert_response :success
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# test "should create account_email" do
|
21
|
+
# assert_difference('AccountEmail.count') do
|
22
|
+
# post :create, account_email: { accountId: @account_email.accountId, email: @account_email.email }
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# assert_redirected_to account_email_path(assigns(:account_email))
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# test "should show account_email" do
|
29
|
+
# get :show, id: @account_email
|
30
|
+
# assert_response :success
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# test "should get edit" do
|
34
|
+
# get :edit, id: @account_email
|
35
|
+
# assert_response :success
|
36
|
+
# end
|
37
|
+
#
|
38
|
+
# test "should update account_email" do
|
39
|
+
# put :update, id: @account_email, account_email: { accountId: @account_email.accountId, email: @account_email.email }
|
40
|
+
# assert_redirected_to account_email_path(assigns(:account_email))
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# test "should destroy account_email" do
|
44
|
+
# assert_difference('AccountEmail.count', -1) do
|
45
|
+
# delete :destroy, id: @account_email
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
# assert_redirected_to account_emails_path
|
49
|
+
# end
|
50
|
+
# end
|
51
|
+
# end
|
@@ -22,7 +22,7 @@ module Kaui
|
|
22
22
|
|
23
23
|
test "should create tag_definition" do
|
24
24
|
assert_difference('TagDefinition.count') do
|
25
|
-
post :create, tag_definition
|
25
|
+
post :create, :tag_definition => { :description => @tag_definition.description, :name => @tag_definition.name }
|
26
26
|
end
|
27
27
|
|
28
28
|
# TODO - for now, we redirect to the main page as we don't get the id back
|
@@ -31,12 +31,12 @@ module Kaui
|
|
31
31
|
end
|
32
32
|
|
33
33
|
test "should show tag_definition" do
|
34
|
-
get :show, id
|
34
|
+
get :show, :id => @tag_definition
|
35
35
|
assert_response :success
|
36
36
|
end
|
37
37
|
|
38
38
|
test "should get edit" do
|
39
|
-
get :edit, id
|
39
|
+
get :edit, :id => @tag_definition
|
40
40
|
assert_response :success
|
41
41
|
end
|
42
42
|
|
@@ -47,11 +47,11 @@ module Kaui
|
|
47
47
|
# end
|
48
48
|
|
49
49
|
test "should destroy tag_definition" do
|
50
|
-
post :create, tag_definition
|
50
|
+
post :create, :tag_definition => { :description => @tag_definition.description, :name => @tag_definition.name }
|
51
51
|
new_id = assigns(:tag_definition).id
|
52
52
|
|
53
53
|
assert_difference('TagDefinition.count', -1) do
|
54
|
-
delete :destroy, id
|
54
|
+
delete :destroy, :id => new_id
|
55
55
|
end
|
56
56
|
|
57
57
|
assert_redirected_to tag_definitions_path
|