Skip to content

Instantly share code, notes, and snippets.

@craigspaeth
Created November 4, 2013 16:43
Show Gist options
  • Save craigspaeth/7305423 to your computer and use it in GitHub Desktop.
Save craigspaeth/7305423 to your computer and use it in GitHub Desktop.
describe 'LocationView', ->
before (done) ->
clientenv.prepare '../client/location_view', module,
serverTemplate:
filename: '../templates/index.jade'
locals: { sd: {} }
clientTemplates: ['template']
done: (mod) =>
{ @LocationView } = mod
@view = new @LocationView(state: @state, user: @user)
# Use benv to re-require the view stubbing jade templates
{ LocationSearchView } = benv.requireWithJadeify(
'../../components/location_search/index.coffee'
['template']
)
# benv uses rewire underneate, which gives us __set__ and __get__
# on the module
mod.__set__ 'LocationSearchView', LocationSearchView
done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment