Last active
December 21, 2015 16:59
-
-
Save jvans1/6337376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('PackageService', function(){ | |
return { | |
tournamentsToHtml: function(tournaments){ | |
var html = "<table class='table table-tooltip'><tr><td>Tournament</td><td>Markup</td></tr><tbody>" | |
for (var key in tournaments) { | |
html += "<tr>" + "<td>" + key + ": " + "</td>" + "<td>" + tournaments[key] + "</td>" + "</tr>" | |
}; | |
html + "</tbody></table>" | |
return html | |
} | |
} | |
}); | |
//= require application | |
describe("PackageService", function(){ | |
describe("#tournamentListToHtml", function(){ | |
var pckService; | |
beforeEach(function(){ | |
module("app"); | |
inject(function(PackageService){ | |
pckService = PackageService | |
}) | |
}) | |
it("convert hash to table", function(){ | |
pckService.tournamentListToHtml({"main event": "1.25", "5k 6m": "1.1"}) | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment