 
 
     it 'should not trigger `Remixer:SwapShell` on link change (same shell)', ->
-      model = new acorn.shells.LinkShell.Model
+      model = new LinkShell.Model
       view = new RemixerView model: model
       spy1 = spyOn(view, 'onLinkChange').andCallThrough()
       spy2 = new EventSpy view, 'Remixer:SwapShell'

      view.render()
      expect(spy1.triggered).toBe false
      expect(spy2.triggered).toBe false
      view.dropdownView.selected acorn.shells.ImageLinkShell.id
      expect(spy1.triggered).toBe true
      expect(spy2.triggered).toBe true
      expect(spy2.arguments[0]).toEqual [view, model, view.model]
      expect(model).not.toEqual view.model

    it 'should not trigger `Remixer:SwapShell` if dropdown select is same', ->
      model = new acorn.shells.LinkShell.Model
      view = new RemixerView model: model
      spy1 = new EventSpy view, 'Remixer:SwapShell'
      spy2 = new EventSpy view, 'Remixer:SwapShell'

goog.provide 'acorn.specs.player.RemixerView'

goog.require 'acorn.player.RemixerView'
goog.require 'acorn.shells.Shell'
goog.require 'acorn.shells.LinkShell'
goog.require 'acorn.shells.ImageLinkShell'
goog.require 'acorn.shells.TextShell'

describe 'acorn.player.RemixerView', ->
  RemixerView = acorn.player.RemixerView
  EventSpy = athena.lib.util.test.EventSpy

  Shell = acorn.shells.Shell
  LinkShell = acorn.shells.LinkShell
  ImageLinkShell = acorn.shells.ImageLinkShell
  TextShell = acorn.shells.TextShell

  # construction options
  model = new Shell.Model

  viewOptions = (opts = {}) ->
    _.defaults opts,
      model: new Shell.Model
      eventhub: new Backbone.View

  it 'should be part of acorn.player', ->
    expect(RemixerView).toBeDefined()

  describeView = athena.lib.util.test.describeView
  describeView RemixerView, athena.lib.View, viewOptions()

  describeSubview = athena.lib.util.test.describeSubview
  describeSubview
    View: RemixerView
    Subview: acorn.player.DropdownView
    subviewAttr: 'dropdownView'
    viewOptions: viewOptions()
    checkDOM: (cEl, pEl) -> cEl.parentNode.parentNode.parentNode is pEl

  describeSubview
    View: RemixerView
    Subview: athena.lib.ToolbarView
    subviewAttr: 'toolbarView'
    viewOptions: viewOptions()
    checkDOM: (cEl, pEl) -> cEl.parentNode.parentNode is pEl

  describeSubview {
    View: RemixerView
    Subview: acorn.player.SummaryView
    subviewAttr: 'summarySubview'
    viewOptions: viewOptions()
  }, ->

    it 'should be initialized if options.showSummary is true', ->
      view = new RemixerView viewOptions showSummary: true
      expect(view.summarySubview).toBeDefined()

    it 'should not be initialized if options.showSummary is false', ->
      view = new RemixerView viewOptions showSummary: false
      expect(view.summarySubview).not.toBeDefined()


