Sha256: c7ab58e961ee3989c5ae51a6dfab6b84f7d9dcc5d37fd54b52428208ea174938
Contents?: true
Size: 1.52 KB
Versions: 16
Compression:
Stored size: 1.52 KB
Contents
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
Version data entries
16 entries across 16 versions & 1 rubygems