Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from gregmalcolm/rearranged_expected
Browse files Browse the repository at this point in the history
Merged. The double rainbows spec always messes people up.
  • Loading branch information
larrymyers committed Jun 21, 2012
2 parents fb2bf6e + 99df726 commit 63fd098
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions js/koans/aboutModels.js
Expand Up @@ -20,19 +20,18 @@ describe('About Backbone.Model', function() {
it('Attributes can be set on the model instance when it is created.', function() {
var todo = new Todo({ text: 'Get oil change for car.' });

var expectedText = 'FIX ME';

expect(expectedText).toEqual(todo.get('text'));
expect(todo.get('text')).toEqual('FIX ME');
});

it('If it is exists, an initialize function on the model will be called when it is created.', function() {
var todo = new Todo({ text: 'Stop monkeys from throwing their own feces!' });

// Why does the expected text differ from what is passed in when we create the Todo?
// What is happening in Todo.initialize? (see js/todos.js line 22)
// You can get this test passing without changing todos.js or the expected text.

expect('Stop monkeys from throwing their own double rainbows!').toBe(todo.get('text'));
// You can get this test passing without changing todos.js or actualText.
var todo = new Todo({ text: 'Stop monkeys from throwing their own feces!' });

actualText = 'Stop monkeys from throwing their own double rainbows!'; // Don't change
expect(todo.get('text')).toBe(actualText);
});

it('Fires a custom event when the state changes.', function() {
Expand Down

0 comments on commit 63fd098

Please sign in to comment.