mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #1614 from velesin/integration_test_helper_improvement
enables passing additional setup / teardown code to integration test helper
This commit is contained in:
commit
bba5631923
1 changed files with 9 additions and 1 deletions
|
@ -1,12 +1,20 @@
|
|||
function integration(name) {
|
||||
function integration(name, lifecycle) {
|
||||
module("Integration: " + name, {
|
||||
setup: function() {
|
||||
sinon.stub(Discourse.ScrollingDOMMethods, "bindOnScroll");
|
||||
sinon.stub(Discourse.ScrollingDOMMethods, "unbindOnScroll");
|
||||
Ember.run(Discourse, Discourse.advanceReadiness);
|
||||
|
||||
if (lifecycle && lifecycle.setup) {
|
||||
lifecycle.setup.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if (lifecycle && lifecycle.teardown) {
|
||||
lifecycle.teardown.call(this);
|
||||
}
|
||||
|
||||
Discourse.reset();
|
||||
Discourse.ScrollingDOMMethods.bindOnScroll.restore();
|
||||
Discourse.ScrollingDOMMethods.unbindOnScroll.restore();
|
||||
|
|
Loading…
Reference in a new issue