Last active
August 29, 2015 13:57
-
-
Save commadelimited/9531131 to your computer and use it in GitHub Desktop.
ember-testing-promises
This file contains 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
describe("reports", function () { | |
before(function() { | |
Ember.run(Social, Social.advanceReadiness); | |
}); | |
afterEach(function() { | |
Social.reset(); | |
}); | |
describe('profiles', function() { | |
beforeEach(function() { | |
visit("/accounts/64"); | |
}); | |
it('should load some profiles', function() { | |
// our code never gets into this block | |
find('#nav-profiles a[href="#/accounts/64"]').should.exist; | |
find('#nav-profiles a[href="#/accounts/281"]').should.exist; | |
}); | |
}); | |
}); |
This file contains 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
/** | |
* Mock API requests with fixture data | |
*/ | |
mock_http('/api/1/profiles/', 'profiles'); | |
mock_http('/api/1/profiles/*/growth/', 'growth'); | |
mock_http('/api/1/profiles/*/engagement/', 'engagement'); | |
mock_http('/api/1/profiles/*/trends/', 'trends'); |
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="mocha.css" /> | |
</head> | |
<body> | |
<div id="mocha"></div> | |
<div id="social-testing"></div> | |
<script> | |
ENV = { | |
LOG_VERSION: false | |
} | |
</script> | |
<!-- Testing harness --> | |
<script src="mocha.js"></script> | |
<script src="expect.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-mockjax/1.5.3/jquery.mockjax.js"></script> | |
<!-- Application dependencies --> | |
<script src="../../emmasocial/assets/js/libs/src/handlebars-1.3.0.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/ember-1.4.0.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/ember-data-1.0.0-beta.7.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/ember-data-django-rest-adapter.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/django-ajax-csrf.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/moment-2.0.0.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/highcharts.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/gumby/gumby.js"></script> | |
<script src="../../emmasocial/assets/js/libs/src/gumby/ui/gumby.retina.js"></script> | |
<script src="../../emmasocial/assets/js/es/src/application.utils.js"></script> | |
<!-- More harness --> | |
<script src="utilities.js"></script> | |
<script src="mock_api.js"></script> | |
<script src="bower_components/ember-mocha-adapter/adapter.js"></script> | |
<!-- Code under test --> | |
<script src="../../emmasocial/assets/js/es/src/application.reports.js"></script> | |
<!-- Tests --> | |
<script src="test_reports.js"></script> | |
<script> | |
mocha.globals(['Ember', 'DS', 'Social']); | |
mocha.timeout(500); | |
$.fx.off = true; | |
if (window.mochaPhantomJS) { mochaPhantomJS.run(); } | |
else { mocha.run(); } | |
Social.rootElement = "#social-testing"; | |
Social.setupForTesting(); | |
Social.injectTestHelpers(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment