Skip to content

Instantly share code, notes, and snippets.

@newtriks
Last active December 16, 2015 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newtriks/5472834 to your computer and use it in GitHub Desktop.
Save newtriks/5472834 to your computer and use it in GitHub Desktop.
'use strict';
describe('Directive: albums', function() {
beforeEach(module('directiveExampleApp'));
var element, scope;
beforeEach(module('views/templates/albums.html'));
beforeEach(inject(function($rootScope, $compile) {
element = angular.element('<div class="well span6">' +
'<h3>Busdriver Albums:</h3>' +
'<albums ng-repeat="album in albums" title="{{album.title}}">' +
'</albums></div>');
scope = $rootScope;
scope.albums = [{
'title': 'Memoirs of the Elephant Man'
}, {
'title': 'Temporary Forever'
}, {
'title': 'Cosmic Cleavage'
}, {
'title': 'Fear of a Black Tangent'
}, {
'title': 'RoadKillOvercoat'
}, {
'title': 'Jhelli Beam'
}, {
'title': 'Beaus$Eros'
}];
$compile(element)(scope);
scope.$digest();
}));
it("should have the correct amount of albums in the list", function() {
var list = element.find('li');
expect(list.length).toBe(7);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment