summaryrefslogtreecommitdiff
path: root/spec/javascripts/application_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/application_spec.js')
-rw-r--r--spec/javascripts/application_spec.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/javascripts/application_spec.js b/spec/javascripts/application_spec.js
new file mode 100644
index 00000000000..b48026c3b77
--- /dev/null
+++ b/spec/javascripts/application_spec.js
@@ -0,0 +1,32 @@
+
+/*= require lib/utils/common_utils */
+
+(function() {
+ describe('Application', function() {
+ return describe('disable buttons', function() {
+ fixture.preload('application.html');
+ beforeEach(function() {
+ return fixture.load('application.html');
+ });
+ it('should prevent default action for disabled buttons', function() {
+ var $button, isClicked;
+ gl.utils.preventDisabledButtons();
+ isClicked = false;
+ $button = $('#test-button');
+ $button.click(function() {
+ return isClicked = true;
+ });
+ $button.trigger('click');
+ return expect(isClicked).toBe(false);
+ });
+ return it('should be on the same page if a disabled link clicked', function() {
+ var locationBeforeLinkClick;
+ locationBeforeLinkClick = window.location.href;
+ gl.utils.preventDisabledButtons();
+ $('#test-link').click();
+ return expect(window.location.href).toBe(locationBeforeLinkClick);
+ });
+ });
+ });
+
+}).call(this);