Skip to content

Commit

Permalink
Clean up tests: add missing var declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Steunou committed Dec 10, 2015
1 parent a0584f4 commit 7b84911
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions test/spec/backbone.computedfields.spec.js
Expand Up @@ -123,6 +123,9 @@ describe('Backbone.ComputedFields spec', function() {
});

describe('when ComputedFields are used', function () {

var model;

beforeEach(function () {
var Model = Backbone.Model.extend({
defaults: {
Expand Down Expand Up @@ -154,6 +157,9 @@ describe('Backbone.ComputedFields spec', function() {
});

describe('when dependent fields are used', function () {

var model;

beforeEach(function () {
var Model = Backbone.Model.extend({
defaults: {
Expand Down Expand Up @@ -185,6 +191,9 @@ describe('Backbone.ComputedFields spec', function() {


describe('when dependent field is changed', function () {

var model;

beforeEach(function () {
var Model = Backbone.Model.extend({
defaults: {
Expand Down Expand Up @@ -244,7 +253,8 @@ describe('Backbone.ComputedFields spec', function() {
});

describe('when calculated field is changed', function () {
var triggerMethodSpy;

var triggerMethodSpy, model;

beforeEach(function () {
var Model = Backbone.Model.extend({
Expand Down Expand Up @@ -284,6 +294,8 @@ describe('Backbone.ComputedFields spec', function() {

describe ('when model changing', function () {

var model;

beforeEach(function () {
var Model = Backbone.Model.extend({
defaults: {
Expand Down Expand Up @@ -398,7 +410,8 @@ describe('Backbone.ComputedFields spec', function() {
});

describe('when model serialized to JSON', function () {
var json;

var json, model;

beforeEach(function () {
var Model = Backbone.Model.extend({
Expand Down Expand Up @@ -511,7 +524,7 @@ describe('Backbone.ComputedFields spec', function() {

describe('when ComputedFields initialized in Backbone.Model via Backbone.Collection', function () {

var model, collection, collectionView;
var model, collection;

beforeEach(function () {
var Model = Backbone.Model.extend({
Expand Down Expand Up @@ -554,6 +567,8 @@ describe('Backbone.ComputedFields spec', function() {

describe('when computed model is validating', function () {

var model;

beforeEach(function () {

var Model = Backbone.Model.extend({
Expand Down Expand Up @@ -604,6 +619,9 @@ describe('Backbone.ComputedFields spec', function() {
});

describe ('when depends on external', function () {

var model;

beforeEach(function () {

var Model = Backbone.Model.extend({
Expand Down Expand Up @@ -647,7 +665,7 @@ describe('Backbone.ComputedFields spec', function() {
expect(model.get('grossPrice')).to.equal(1);
});
});

it ('should not pass the depends function as a field', function() {
var computedDef = model.computed.grossPrice;
var dependsFunction = computedDef.depends[2];
Expand Down

0 comments on commit 7b84911

Please sign in to comment.