Skip to content

Commit

Permalink
chore(test) fix jshint errors in spec file
Browse files Browse the repository at this point in the history
  • Loading branch information
bostrom committed Jan 4, 2017
1 parent 8552c51 commit 1a988cb
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions test/restangularSpec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* global describe, beforeEach, inject, afterEach, it, expect, spyOn */
/* jshint unused: false */
describe('Restangular', function() {
// API
var Restangular, $httpBackend;
var accountsModel, restangularAccounts, restangularAccount0, restangularAccount1;
var accountsHalModel;
var messages, newAccount, nextAccountId;
var Restangular, $httpBackend,
accountsModel, restangularAccounts, restangularAccount0, restangularAccount1,
infoModel, accountsDoSomethingModel, customers, publications, newCustomer,
accountsHalModel,
messages, newAccount, nextAccountId;

// Load required modules
beforeEach(angular.mock.module('restangular'));
Expand Down Expand Up @@ -873,7 +876,7 @@ describe('Restangular', function() {
}).then(function(accountFromServer2) {
expect(accountFromServer2.route).toBe(account1.route);
});
$httpBackend.flush()
$httpBackend.flush();
});

it('Should make RequestLess connections with one', function() {
Expand Down Expand Up @@ -1018,7 +1021,7 @@ describe('Restangular', function() {
});

it('should allow for a custom method to be placed at the model level when several models are requested', function() {
var accountPromise;
var accountsPromise;

Restangular.addElementTransformer('accounts', false, function(model) {
model.prettifyAmount = function() {};
Expand All @@ -1028,16 +1031,16 @@ describe('Restangular', function() {
accountsPromise = Restangular.all('accounts', 1).getList();

accountsPromise.then(function(accounts) {
accounts.forEach(function(account, index) {
accounts.forEach(function(account) {
expect(typeof account.prettifyAmount).toEqual('function');
});
});

$httpBackend.flush();
});

it("should allow for a custom method to be placed at the collection level using a regexp matching the route", function() {
var accountPromise;
it('should allow for a custom method to be placed at the collection level using a regexp matching the route', function() {
var accountsPromise;

Restangular.addElementTransformer(/^accounts/, false, function(model) {
model.prettifyAmount = function() {};
Expand All @@ -1047,15 +1050,15 @@ describe('Restangular', function() {
accountsPromise = Restangular.all('accounts/search/byOwner', 1).getList();

accountsPromise.then(function(accounts) {
accounts.forEach(function(account, index) {
expect(typeof account.prettifyAmount).toEqual("function");
accounts.forEach(function(account) {
expect(typeof account.prettifyAmount).toEqual('function');
});
});

$httpBackend.flush();
});

it("should allow for a custom method to be placed at the model level using regexp route when one model is requested", function() {
it('should allow for a custom method to be placed at the model level using regexp route when one model is requested', function() {
var accountPromise;

Restangular.addElementTransformer(/^accounts/, false, function(model) {
Expand All @@ -1066,14 +1069,14 @@ describe('Restangular', function() {
accountPromise = Restangular.one('accounts', 1).get();

accountPromise.then(function(account) {
expect(typeof account.prettifyAmount).toEqual("function");
expect(typeof account.prettifyAmount).toEqual('function');
});

$httpBackend.flush();
});

it("should allow for a custom method to be placed at the model level using regexp when several models are requested", function() {
var accountPromise;
it('should allow for a custom method to be placed at the model level using regexp when several models are requested', function() {
var accountsPromise;

Restangular.addElementTransformer(/^accounts/, false, function(model) {
model.prettifyAmount = function() {};
Expand All @@ -1083,8 +1086,8 @@ describe('Restangular', function() {
accountsPromise = Restangular.all('accounts', 1).getList();

accountsPromise.then(function(accounts) {
accounts.forEach(function(account, index) {
expect(typeof account.prettifyAmount).toEqual("function");
accounts.forEach(function(account) {
expect(typeof account.prettifyAmount).toEqual('function');
});
});

Expand Down Expand Up @@ -1244,7 +1247,7 @@ describe('Restangular', function() {
});

it('getRestangularUrl() returns still the url without id after GET', function() {
record = Restangular.one('info', 0, true);
var record = Restangular.one('info', 0, true);
record.get().then(function(data) {
expect(data.getRestangularUrl()).toEqual('/info');
});
Expand Down

0 comments on commit 1a988cb

Please sign in to comment.