-
-
Save pwfisher/36e85f8098f1001912a8 to your computer and use it in GitHub Desktop.
JSBin for Ember.js test setup with QUnit (http://jsbin.com/soxawi/edit)
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
#ember-testing-container { | |
position: absolute; | |
background: white; | |
bottom: 0; | |
right: 0; | |
width: 640px; | |
height: 384px; | |
overflow: auto; | |
z-index: 9999; | |
border: 1px solid #ccc; | |
} | |
#ember-testing { | |
zoom: 50%; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-latest.js"></script> | |
<script src="http://builds.emberjs.com/release/ember.js"></script> | |
<script src="http://builds.emberjs.com/release/ember-data.js"></script> | |
<script src="http://code.jquery.com/qunit/qunit-git.js"></script> | |
<script src="http://cdn.rawgit.com/rwjblue/ember-qunit-builds/v0.4.10/ember-qunit.js"></script> | |
<script src="http://builds.emberjs.com/latest/ember-template-compiler.js"></script> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.12.0.css" media="all"> | |
</head> | |
<body> | |
<div id="qunit"></div> | |
<div id="qunit-fixture"></div> | |
<div id="ember-testing-container"> | |
<div id="ember-testing"></div> | |
</div> | |
<script type="text/x-handlebars"> | |
{{outlet}} | |
</script> | |
<script type="text/x-handlebars" id="index"> | |
<h1>People</h1> | |
<ul> | |
{{#each model}} | |
<li class="people">Hello, <b>{{fullName}}</b>!</li> | |
{{/each}} | |
</ul> | |
</script> | |
</body> | |
</html> |
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
App = Ember.Application.create(); | |
Ember.testing = true; | |
App.rootElement = '#ember-testing'; | |
App.setupForTesting(); | |
App.injectTestHelpers(); | |
setResolver(Ember.DefaultResolver.create({ namespace: App })); | |
App.MessageList = DS.Model.extend({ | |
messages: function () { return []; }.property(), | |
addMessage: function (x) { | |
this.get('messages').push(x); | |
} | |
}); | |
moduleForModel('message-list'); | |
test('it should add a message string', function (assert) { | |
this.subject().addMessage('test message'); | |
assert.equal(true, true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment