chai-backbone icon indicating copy to clipboard operation
chai-backbone copied to clipboard

Router tests always passing

Open StevenLangbroek opened this issue 11 years ago • 4 comments

Hey Matthijs,

I'm using Marionette, which implements an extended version of Backbone.Router. When I instantiate a new AppRouter, and test a route ("apps".should.route.to router, "showApps"), it always passes, even if I make a bogus router like so:

describe 'Router', ->

  beforeEach ->
    Backbone.history.start()

  afterEach ->
    Backbone.history.stop()

  it 'should have a router', ->
    App.AppsApp.Router.should.be.a 'function'

  it 'should respond to apps route', ->
    API =
      showApps: -> return
    router = new App.AppsApp.Router controller: API
    otherRouter = new Backbone.Router

    "apps".should.route.to otherRouter, "showApps"

Any idea why this is passing?

StevenLangbroek avatar Mar 24 '14 09:03 StevenLangbroek

I will look into it

matthijsgroen avatar Mar 26 '14 13:03 matthijsgroen

Hey Matthijs,

Any word on this? Anything I can do to help out?

StevenLangbroek avatar May 30 '14 12:05 StevenLangbroek

Problem is, I never used Marionette. (Never had a real usecase for it). A demo app with the minimal setup to reproduce the issue would be the best.

matthijsgroen avatar Jun 04 '14 04:06 matthijsgroen

@StevenLangbroek could this be fixed in the current version?

matthijsgroen avatar Nov 12 '15 22:11 matthijsgroen