summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-12-02 16:03:18 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2016-12-02 16:03:18 +0000
commit2f91c0eef45e9501ba90976a64886aee56b90b46 (patch)
treece4fb0261b7844e7b99e03c23d15f78ca953baa5 /spec/javascripts
parentaf19d56f5e20383a142f07545757352b341fcda9 (diff)
parentf90b6200e450f6b87cc310ab5734a09719d891d3 (diff)
downloadgitlab-ce-2f91c0eef45e9501ba90976a64886aee56b90b46.tar.gz
Merge branch 'cleanup-common_utils.js' into 'master'
Clean up common_utils.js ## What does this MR do? - Remove unused functions from `common_utils.js`. - Move functions which are used from only one file to that file. ## Why was this MR needed? Because some utils weren't that common (anymore). See merge request !7318
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/application_spec.js37
-rw-r--r--spec/javascripts/fixtures/application.html.haml2
2 files changed, 0 insertions, 39 deletions
diff --git a/spec/javascripts/application_spec.js b/spec/javascripts/application_spec.js
deleted file mode 100644
index 7e38abc608e..00000000000
--- a/spec/javascripts/application_spec.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* eslint-disable space-before-function-paren, one-var, no-var, one-var-declaration-per-line, no-return-assign, padded-blocks, max-len */
-
-/*= 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');
- expect($button).toExist();
- $button.click(function() {
- return isClicked = true;
- });
- $button.trigger('click');
- return expect(isClicked).toBe(false);
- });
-
- it('should be on the same page if a disabled link clicked', function() {
- var locationBeforeLinkClick, $link;
- locationBeforeLinkClick = window.location.href;
- gl.utils.preventDisabledButtons();
- $link = $('#test-link');
- expect($link).toExist();
- $link.click();
- return expect(window.location.href).toBe(locationBeforeLinkClick);
- });
- });
- });
-
-}).call(this);
diff --git a/spec/javascripts/fixtures/application.html.haml b/spec/javascripts/fixtures/application.html.haml
deleted file mode 100644
index 3fc6114407d..00000000000
--- a/spec/javascripts/fixtures/application.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%a#test-link.btn.disabled{:href => "/foo"} Test link
-%button#test-button.btn.disabled Test Button