diff --git a/test/SpecRunner.html b/test/SpecRunner.html index 57af9be..ad89373 100644 --- a/test/SpecRunner.html +++ b/test/SpecRunner.html @@ -7,27 +7,44 @@ - - - - + - + + @@ -43,18 +60,36 @@ "domReady!", "spec/MainSpec" ], - function( document ){ + function( jasmine ){ + + // window.jasmine = jasmineRequire.core(jasmineRequire); + // + // jasmineRequire.html(jasmine); + // + // var jasmineEnv = jasmine.getEnv(); + // jasmineEnv.updateInterval = 1000; + // + // var htmlReporter = new jasmine.HtmlReporter(); + // + // jasmineEnv.addReporter(htmlReporter); + // + // jasmineEnv.specFilter = function (spec) { + // return htmlReporter.specFilter(spec); + // }; + // Set up the HTML reporter - this is reponsible for // aggregating the results reported by Jasmine as the // tests and suites are executed. - jasmine.getEnv().addReporter( - new jasmine.HtmlReporter() - ); - - // Run all the loaded test specs. - jasmine.getEnv().execute(); - + // jasmine.getEnv().addReporter( + // new jasmine.HtmlReporter() + // ); + // + // // Run all the loaded test specs. + // jasmine.getEnv().execute(); + if(typeof window.onload == 'function'){ + window.onload(); + } } ); diff --git a/test/spec/MainSpec.js b/test/spec/MainSpec.js index d1acfe1..bf372ca 100644 --- a/test/spec/MainSpec.js +++ b/test/spec/MainSpec.js @@ -1,9 +1,16 @@ -define(["model/main"],function(Main){ +define(['jasmine-boot', 'model/proposal-app'],function(jasmine, ProposalApp){ - describe("addVotedProposal", function(){ - it("Should register a voted id", function(){ - expect(Main.addVotedProposal(1)).toContain(1); + describe("Limit proposal voting to one per browser", function(){ + it("Should register a proposal id", function(){ + expect(ProposalApp.addVotedProposal(99)).toContain(99); + }); + it("Should find a voted proposal", function(){ + ProposalApp.addVotedProposal(3); + expect(ProposalApp.hasProposalbeenVoted(3)).toBe(true); }); + }); + + }); -- libgit2 0.21.2