 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 acorn.shells.Shell.Model
-
-  options =
-    model: model
+  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, options
+  describeView RemixerView, athena.lib.View, viewOptions()
 
   describeSubview = athena.lib.util.test.describeSubview
   describeSubview
     View: RemixerView
     Subview: acorn.player.DropdownView
     subviewAttr: 'dropdownView'
-    viewOptions: options
+    viewOptions: viewOptions()
     checkDOM: (cEl, pEl) -> cEl.parentNode.parentNode.parentNode is pEl
 
   describeSubview
     View: RemixerView
     Subview: athena.lib.ToolbarView
     subviewAttr: 'toolbarView'
-    viewOptions: options
+    viewOptions: viewOptions()
     checkDOM: (cEl, pEl) -> cEl.parentNode.parentNode is pEl
 
   describeSubview {
     View: RemixerView
     Subview: acorn.player.SummaryView
     subviewAttr: 'summarySubview'
-    viewOptions: options
+    viewOptions: viewOptions()
   }, ->
 
     it 'should be initialized if options.showSummary is true', ->
-      view = new RemixerView _.extend {}, options, {showSummary: true}
+      view = new RemixerView viewOptions showSummary: true
       expect(view.summarySubview).toBeDefined()
 
     it 'should not be initialized if options.showSummary is false', ->
-      view = new RemixerView _.extend {}, options, {showSummary: false}
+      view = new RemixerView viewOptions showSummary: false
       expect(view.summarySubview).not.toBeDefined()
 
 

      expect(view.model.link()).toBe 'http://athena.ai'

    it 'should trigger `Remixer:LinkShell` on editing link (diff shell)', ->
      model = new acorn.shells.ImageLinkShell.Model
      view = new RemixerView model: model
      spy1 = spyOn(view, 'onLinkChange').andCallThrough()
      spy2 = new EventSpy view, 'Remixer:LinkChanged'

    acorn.util.appendCss()
    $player = $('<div>').addClass('acorn-player').appendTo('body')

    view = new RemixerView viewOptions()
    view.$el.width 600
    view.render()
    $player.append view.el

    view = new RemixerView viewOptions
      toolbarButtons: []
      validShells: [ImageLinkShell]

    view.$el.width 600
    view.render()
