Last active
December 25, 2015 05:09
-
-
Save brian-mann/6922710 to your computer and use it in GitHub Desktop.
spying on ui hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #= require support/spec_helper | |
| class View extends App.Views.ItemView | |
| template: "tooltips" | |
| describe "Tooltip Concerns", -> | |
| beforeEach -> | |
| @view = new View | |
| @view.onRender = => | |
| @tooltip = sinon.spy(@view.ui.tooltips, "tooltip") | |
| App.mainRegion.show @view | |
| afterEach -> | |
| @view.ui.tooltips.tooltip?.restore?() | |
| it "references tooltips in the ui", -> | |
| expect(@view.ui.tooltips).to.exist | |
| it "enables tooltips", -> | |
| expect(@tooltip).to.have.been.called | |
| it "disables tooltips when the view is closed", -> | |
| App.mainRegion.close() | |
| expect(@tooltip).to.have.been.calledWith("destroy") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment