Created
January 13, 2014 20:03
-
-
Save knomedia/8407012 to your computer and use it in GitHub Desktop.
Revisions
-
knomedia created this gist
Jan 13, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ define [ '../start_app', 'ember', 'ic-ajax', '../../controllers/quiz_controller', '../environment_setup', ], (startApp, Ember, ajax, QuizController) -> App = null module 'quizzes_controller', setup: -> App = startApp() cont = new Em.Container() cont.register('controller:quizzes', Em.Object) @qc = App.QuizController.create({container: cont}) @qc.set('model', {points_possible: 1, title: 'Assignment test'}) teardown: -> Ember.run App, 'destroy' test 'display singular points possible', -> equal(@qc.get('pointsPossible'), '1 pt') test 'display mulitple points possible', -> @qc.set('model', {points_possible: 2, title: 'Assignment test'}) equal(@qc.get('pointsPossible'), '2 pts') test 'doesnt display when zero points possible', -> @qc.set('model', {points_possible: 0, title: 'Assignment test'}) equal(@qc.get('pointsPossible'), '') test 'doesnt display when undefined points possible', -> @qc.set('model', {title: 'Assignment test'}) equal(@qc.get('pointsPossible'), '')