-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with testing #38
Comments
An explicit test("Login, render dashboard", function() {
expect(1);
visit("/user/login");
fillIn("#identification","test");
fillIn("#password","test");
Ember.run(function() {
click("#btnLogin");
})
andThen( function() {
equal(find(".island").length, 4, "Multiple islands should be rendered");
});
}); that probably fixes the problem as well and is cleaner. |
I agree that this "should" work. This was the first thing we tired. The click helper is actually wrapped in an Ember.run(). We thought that perhaps you might want to use a combination of if ( Ember.testing ) and our proposed Ember.run() in combination in your login code. It works great in production code, just not in our testing. |
I think adding an |
We've been having problems with unit tests. The test was fairly straight forward:
And the result in the console was:
Assertion failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run
In the debugger, we stepped through jQuery where it executes callbacks for AJAX responses. Eventually we found it. We needed to wrap your functionality with Ember.run() in your login function. This is around like 439 of ember-simple-auth.js in version 0.0.9.
This has fixed the issue! Thought you should know.
Regards.
The text was updated successfully, but these errors were encountered: