generator-fatarrow
Version:
49 lines (33 loc) • 941 B
text/coffeescript
describe 'script', ->
describe 'scriptService', ->
beforeEach module 'app'
beforeEach inject (, ) ->
getScriptTag = (url) ->
script = "<script src=\"#{url}\"></script>"
it 'adds a script', ->
url = '//foo/bar.js'
.add url
html = .find('body').html()
expect html
.toContain getScriptTag url
it 'adds multiple scripts', ->
url1 = '//foo/bar.js'
url2 = '//biz/baz.js'
.add url1
.add url2
html = .find('body').html()
expect html
.toContain getScriptTag url1
expect html
.toContain getScriptTag url2
it 'gets an array of scripts', ->
url1 = '//foo/bar.js'
url2 = '//biz/baz.js'
.add url1
.add url2
scripts = .get()
isArray = Array.isArray scripts
expect isArray
.toEqual true
expect isArray
.not.toEqual false