Created
July 15, 2013 23:12
-
-
Save RyanHirsch/6004320 to your computer and use it in GitHub Desktop.
FixtureAdapter test
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 characters
var FixtureModel, adapter; | |
module("Ember.FixtureAdapter", { | |
setup: function() { | |
FixtureModel = Ember.Model.extend({ | |
name: Ember.attr() | |
}); | |
adapter = FixtureModel.adapter = Ember.FixtureAdapter.create(); | |
} | |
}); | |
test("findAll loads the full FIXTURES payload when collectionKey isn't specified", function() { | |
expect(1); | |
var data = [ | |
{id: 1, name: 'Erik'}, | |
{id: 2, name: 'Aaron'} | |
], | |
records; | |
FixtureModel.collectionKey = undefined; | |
FixtureModel.FIXTURES = data; | |
Ember.run(function() { | |
records = FixtureModel.findAll(); | |
}); | |
equal(records.get('length'), data.length, "The proper number of items should have been loaded."); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results in