diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2016-12-10 15:04:54 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2016-12-10 15:04:54 +0300 |
commit | bc31040ea9344e8bc4d3c90fa49a6e30ce9c3698 (patch) | |
tree | ad47b4b2d8226766f10247f8c30e37dd3a8689e1 /spec/javascripts | |
parent | 3f768f9a14ad90bbd79d384e3c287db4feea3e35 (diff) |
Fixed lint warning and propose fail or warning
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/project_title_spec.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/spec/javascripts/project_title_spec.js b/spec/javascripts/project_title_spec.js index 49211a6b852..65de1756201 100644 --- a/spec/javascripts/project_title_spec.js +++ b/spec/javascripts/project_title_spec.js @@ -21,16 +21,18 @@ return this.project = new Project(); }); return describe('project list', function() { + var fakeAjaxResponse = function fakeAjaxResponse(req) { + var d; + expect(req.url).toBe('/api/v3/projects.json?simple=true'); + d = $.Deferred(); + d.resolve(this.projects_data); + return d.promise(); + }; + beforeEach((function(_this) { return function() { _this.projects_data = fixture.load('projects.json')[0]; - return spyOn(jQuery, 'ajax').and.callFake(function(req) { - var d; - expect(req.url).toBe('/api/v3/projects.json?simple=true'); - d = $.Deferred(); - d.resolve(_this.projects_data); - return d.promise(); - }); + return spyOn(jQuery, 'ajax').and.callFake(fakeAjaxResponse.bind(_this)); }; })(this)); it('to show on toggle click', (function(_this) { |