Skip to content

Instantly share code, notes, and snippets.

@charleshan
Created April 10, 2015 20:37
Show Gist options
  • Select an option

  • Save charleshan/fadcebebd3eac9c139a7 to your computer and use it in GitHub Desktop.

Select an option

Save charleshan/fadcebebd3eac9c139a7 to your computer and use it in GitHub Desktop.

Revisions

  1. Charles Han created this gist Apr 10, 2015.
    26 changes: 26 additions & 0 deletions lists-show-test.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    if (!(typeof MochaWeb === 'undefined')){
    MochaWeb.testOnly(function(){
    describe("lists-show", function(){
    it("creates a new task", function(){
    Template.appBody.fireEvent('click .js-new-list');
    var form = $("<form></form>");
    var obj = $('<input/>').attr('type', 'text').val('item 1');
    form.append(obj);
    Template.listsShow.fireEvent('submit .js-todo-new', {
    event: {
    target: form,
    preventDefault: function () {}
    }
    });
    chai.assert.equal(Todos.find().count(), 1);
    });

    afterEach(function() {
    var list = Lists.findOne();
    Lists.remove(list._id);
    var todos = Todos.findOne();
    Todos.remove(todos._id);
    });
    });
    });
    }