diff options
| author | mo k <mo@mokhan.ca> | 2012-09-18 14:52:34 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-09-18 14:52:34 -0600 |
| commit | cfd4494575a24cf812f16a0862ec27fa94369261 (patch) | |
| tree | 150a894c0b08f14b68b04d124c63ec8621789b5c /spec/javascripts | |
| parent | bddf8eb82fc70b6fde1beb2dd57b18580a3c36c2 (diff) | |
switch up presenter spec to use dom elements.
Diffstat (limited to 'spec/javascripts')
| -rw-r--r-- | spec/javascripts/presenters/new_tutorial_presenter_spec.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/javascripts/presenters/new_tutorial_presenter_spec.js b/spec/javascripts/presenters/new_tutorial_presenter_spec.js index f98cf418..fa14eb54 100644 --- a/spec/javascripts/presenters/new_tutorial_presenter_spec.js +++ b/spec/javascripts/presenters/new_tutorial_presenter_spec.js @@ -1,6 +1,11 @@ describe ("NewTutorialPresenter", function() { beforeEach (function() { - view = {add_tag:null}; + view = { + add_tag:null, + add_tag_button: $('<button id="add-tag-button">'), + tag_list: $('<ul id="tag-list">'), + tag_input: $('<input type="text" />'), + }; sut = new NewTutorialPresenter(view); }); var sut; @@ -14,4 +19,14 @@ describe ("NewTutorialPresenter", function() { sut.add_tag('blah'); }); }); + describe ("when the add tag button is clicked", function() { + it ("should add the new tag to the list of tags", function() { + expect(view.tag_list.html()).toEqual('<li><a href="#" class="label">ruby</a></li>'); + }); + beforeEach (function() { + sut.present(); + view.tag_input.val('ruby'); + view.add_tag_button.trigger('click'); + }); + }); }); |
