Commit e0de6bd3 authored by Randall Leeds's avatar Randall Leeds

Move isEmbedded responsibility to AppController

parent 2cad4fc7
......@@ -40,10 +40,6 @@ describe "AnnotationViewerController", ->
"AnnotationViewerController", locals)
return locals
it "sets the isEmbedded property to false", ->
{$scope} = createAnnotationViewerController({})
assert.isFalse($scope.isEmbedded)
it "calls the annotation API to get the annotation", ->
{store} = createAnnotationViewerController({})
assert store.AnnotationResource.read.args[0][0].id == "test_annotation_id"
......@@ -19,8 +19,9 @@ describe 'AppController', ->
sandbox = null
createController = ->
$controller('AppController', {$scope: $scope})
createController = (locals={}) ->
locals.$scope = $scope
$controller('AppController', locals)
before ->
angular.module('h', ['ngRoute'])
......@@ -116,6 +117,19 @@ describe 'AppController', ->
afterEach ->
sandbox.restore()
describe 'isEmbedded property', ->
it 'is false if the window is the top window', ->
$window = {}
$window.top = $window
createController({$window})
assert.isFalse($scope.isEmbedded)
it 'is true if the window is not the top window', ->
$window = {top: {}}
createController({$window})
assert.isTrue($scope.isEmbedded)
it 'watches the identity service for identity change events', ->
createController()
assert.calledOnce(fakeIdentity.watch)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment