From f0bd1f9f06708599ddbd08d2db7066f56db8fe89 Mon Sep 17 00:00:00 2001 From: cmrd Senya Date: Mon, 8 Aug 2016 11:37:37 +0300 Subject: [PATCH] AspectSelections spec corrections --- .../app/collections/aspect_selections_spec.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/spec/javascripts/app/collections/aspect_selections_spec.js b/spec/javascripts/app/collections/aspect_selections_spec.js index 448a9eed3..a2b232d13 100644 --- a/spec/javascripts/app/collections/aspect_selections_spec.js +++ b/spec/javascripts/app/collections/aspect_selections_spec.js @@ -39,22 +39,17 @@ describe("app.collections.AspectSelections", function() { }); describe("#toSentence", function() { - describe("without aspects", function() { + describe("with one aspect", function() { beforeEach(function() { this.aspects = new app.collections.AspectSelections([{name: "Work", selected: false}]); }); - it("returns the name of the aspect", function() { + it("returns 'My aspects' when the apsect isn't selected", function() { expect(this.aspects.toSentence()).toEqual("My aspects"); }); - }); - describe("with one aspect", function() { - beforeEach(function() { - this.aspects = new app.collections.AspectSelections([{name: "Work", selected: true}]); - }); - - it("returns the name of the aspect", function() { + it("returns the name of the aspect when the aspect is selected", function() { + this.aspects.at(0).set({selected: true}); expect(this.aspects.toSentence()).toEqual("Work"); }); });