Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RequestTest depended on ApplicationTest. Fixed.

  • Loading branch information...
commit 73458f11dcfd57c076a9e25b382a9d96c5c0dd2b 1 parent aa87bf8
Rasmus Rønn Nielsen authored
13 test/cases/application_test.coffee
View
@@ -1,5 +1,6 @@
Janitor = require 'janitor'
Wingman = require '../../.'
+jsdom = require 'jsdom'
JSDomWindowPopStateDecorator = require '../jsdom_window_pop_state_decorator'
Wingman.localStorage = require 'localStorage'
@@ -18,9 +19,15 @@ class ControllerWithView extends Wingman.Controller
module.exports = class ApplicationTest extends Janitor.TestCase
setup: ->
- Wingman.document = require('jsdom').jsdom()
+ Wingman.document = jsdom.jsdom()
Wingman.window = JSDomWindowPopStateDecorator.create(Wingman.document.createWindow())
+ teardown: ->
+ delete Wingman.Application.instance
+ Wingman.View.templateSources = {}
+ delete Wingman.document
+ delete Wingman.window
+
'test most basic application': ->
class MyApp extends Wingman.Application
class MyApp.RootView extends Wingman.View
@@ -252,7 +259,3 @@ module.exports = class ApplicationTest extends Janitor.TestCase
new MyApp
@assertEqual '<div>hello</div>', Wingman.document.body.innerHTML
-
- teardown: ->
- delete Wingman.Application.instance
- Wingman.View.templateSources = {}
8 test/cases/controller_test.coffee
View
@@ -1,7 +1,7 @@
Janitor = require 'janitor'
Wingman = require '../../.'
WingmanObject = require '../../lib/wingman/shared/object'
-Wingman.document = require('jsdom').jsdom()
+jsdom = require 'jsdom'
class DummyView extends Wingman.View
templateSource: -> '<div>test</div>'
@@ -12,6 +12,12 @@ class ControllerWithView extends Wingman.Controller
super options
module.exports = class ControllerTest extends Janitor.TestCase
+ setup: ->
+ Wingman.document = jsdom.jsdom()
+
+ teardown: ->
+ delete Wingman.document
+
'test ready callback': ->
callbackFired = false
DummyController = class extends ControllerWithView
9 test/cases/request_test.coffee
View
@@ -2,8 +2,17 @@ Janitor = require 'janitor'
Wingman = require '../../.'
Wingman.document = require('jsdom').jsdom()
sinon = require 'sinon'
+jsdom = require 'jsdom'
module.exports = class extends Janitor.TestCase
+ setup: ->
+ Wingman.document = jsdom.jsdom()
+ Wingman.window = Wingman.document.createWindow()
+
+ teardown: ->
+ delete Wingman.document
+ delete Wingman.window
+
'test host addition': ->
Wingman.request.realRequest = sinon.spy()
class FunkySocks extends Wingman.Application
Please sign in to comment.
Something went wrong with that request. Please try again.