Sha256: 830592e0001be808c933c04cf5b72428f2ec2f985014a03f49abfed514ef6e28
Contents?: true
Size: 792 Bytes
Versions: 60
Compression:
Stored size: 792 Bytes
Contents
describe('Filter:arrayToString', function() { var array, arrayToStringFilter; beforeEach(module('Bastion.components.formatters')); beforeEach(inject(function($filter) { array = [ {id: 1, name: 'one'}, {id: 2, name: 'two'}, {id: 3, name: 'three'} ]; arrayToStringFilter = $filter('arrayToString'); })); it("transforms an array to a string.", function() { expect(arrayToStringFilter(array, "id")).toBe('1, 2, 3'); }); it("defaults item to pluck to 'name' if not provided.", function() { expect(arrayToStringFilter(array)).toBe('one, two, three'); }); it("allows a custom separator", function() { expect(arrayToStringFilter(array, "id", ':')).toBe('1:2:3'); }); });
Version data entries
60 entries across 60 versions & 1 rubygems