From 8a1b16936099164777edbddce4d859f2d7e7b3ae Mon Sep 17 00:00:00 2001 From: pikesley Date: Mon, 18 Jan 2016 21:34:41 +0000 Subject: [PATCH] Woop --- spec/javascripts/list_spec.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/spec/javascripts/list_spec.js b/spec/javascripts/list_spec.js index 0821fa2..4f353c0 100644 --- a/spec/javascripts/list_spec.js +++ b/spec/javascripts/list_spec.js @@ -56,5 +56,33 @@ describe('Resusable lists', function() { break } }) + + describe('with a recursive template', function() { + var json = { + 'templates': [ + '@things and @stuff' + ], + 'things': [ + 'Lions', + 'Tigers', + 'Bears' + ], + 'stuff': [ + '@things and @things' + ] + } + + it('reuses the list when things get recursive', function() { + templated = template(json) + words = templated.split(' ').sort() + expect(words).toEqual([ + 'Bears', + 'Lions', + 'Tigers', + 'and', + 'and' + ]) + }) + }) }) })