I"(function() { describe("Quby.Collections.Questions", function() { beforeEach(function() { this.questionOption = new Quby.Models.QuestionOption; this.question = new Quby.Models.Question({ options: new Quby.Collections.QuestionOptions([this.questionOption]) }); this.questionC = new Quby.Collections.Questions; return this.questionC.add([this.question]); }); describe("#noneVisible", function() { it("returns true if all questions are not visible", function() { this.questionC.each(function(question) { return question.isVisible = sinon.stub().returns(false); }); return expect(this.questionC.noneVisible()).toEqual(true); }); it("returns false if some questions are visible", function() { this.question.isVisible = sinon.stub().returns(true); return expect(this.questionC.noneVisible()).toEqual(false); }); return it("returns false if there are no questions in the collection", function() { return expect(new Quby.Collections.Questions().noneVisible()).toEqual(false); }); }); return describe("#addQuestions", function() { return it('adds the question to the collection', function() { var allQuestions; allQuestions = new Quby.Collections.Questions; sinon.spy(allQuestions, 'add'); allQuestions.addQuestions(this.questionC); return expect(allQuestions.add).toHaveBeenCalledWith(this.questionC.models); }); }); }); }).call(this); :ET