Skip to content

Commit

Permalink
properly failing model specs
Browse files Browse the repository at this point in the history
  • Loading branch information
larrymyers committed Dec 19, 2011
1 parent b6d5b06 commit 9f3ad0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions js/koans/aboutModels.js
Expand Up @@ -3,19 +3,15 @@ describe('About Backbone.Model', function() {
it('Can be created with default values for its attributes.', function() {
var todo = new Todo();

expect(todo.get('text')).toBe("");
expect(todo.get('done')).toBe(false);
expect(todo.get('order')).toBe(0);
expect(todo.get('text')).toBe("What should the default be here?");
});

it('Will set passed attributes on the model instance when created.', function() {
var now = new Date();

var todo = new Todo({ text: 'Get oil change for car.' });

expect(todo.get('text')).toBe('Get oil change for car.');
expect(todo.get('done')).toBe(false);
expect(todo.get('order')).toBe(0);
expect(todo.get('text')).toBe("FIX ME");
expect(todo.get('done')).toBe("FIX ME");
expect(todo.get('order')).toBe("FIX ME");
});

it('Will call a custom initialize function on the model instance when created.', function() {
Expand Down Expand Up @@ -44,7 +40,7 @@ describe('About Backbone.Model', function() {

todo.bind('error', errorCallback);

// What would you need to set on the todo to cause validation to fail?
// What would you need to set on the todo properties to cause validation to fail?

var errorArgs = errorCallback.mostRecentCall.args;

Expand Down
2 changes: 1 addition & 1 deletion specrunner.html
Expand Up @@ -16,7 +16,7 @@
<script type="text/javascript" src="js/koansReporter.js"></script>

<script type="text/javascript" src="koans/aboutEvents.js"></script>
<script type="text/javascript" src="js/koans/aboutModels.js"></script>
<script type="text/javascript" src="koans/aboutModels.js"></script>
<!-- <script type="text/javascript" src="koans/aboutCollections.js"></script> -->
<!-- <script type="text/javascript" src="koans/aboutViews.js"></script> -->
</head>
Expand Down

0 comments on commit 9f3ad0f

Please sign in to comment.