Skip to content
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

blueprints/controller-test: Add RFC232 variants #15943

Merged
merged 2 commits into from
Dec 9, 2017

Conversation

snewcomer
Copy link
Contributor

Progress on #15933

import { setupTest } from 'ember-qunit';

module('<%= friendlyTestDescription %>', function(hooks) {
setupTest(hooks);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do needs go? Should we indicate how those can be added to the registry or is this not a thing anymore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gloriously not a thing anymore.

to stub out lookups (if need be) we use this.owner.register -- example:

this.owner.register('service:feature', Service.extend({
    myFeature: false
});

probably don't need to document that here though

@@ -0,0 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since only a unit test is generated, should this be named rfc232-default or is the current name fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as is seems fine to me, it's not lying -- it is a unit test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a unit test

is it though... :trollface:

I'd just use rfc232.js in this case, but it doesn't matter much.

Copy link
Contributor

@alexander-alvarez alexander-alvarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for hopping in to help @snewcomer

@@ -0,0 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a unit test

is it though... :trollface:

I'd just use rfc232.js in this case, but it doesn't matter much.


// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.factoryFor('controller:<%= controllerPathName %>').create();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tweak this to use this.owner.lookup(‘controller:foo’);? Controllers are intended to be singletons, so we don’t have to factoryFor(...).create()..

@rwjblue rwjblue merged commit ded4256 into emberjs:master Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants