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

Add integration-test blueprint #985

Merged
merged 1 commit into from
Jun 12, 2014

Conversation

jgwhite
Copy link
Contributor

@jgwhite jgwhite commented Jun 11, 2014

$ ember g integration-test foo
version: 0.0.34
installing
  create tests/integration/foo-test.js
import startApp from '../helpers/start-app';

var App;

module('Integration - Foo', {
  setup: function() {
    App = startApp();
  },
  teardown: function() {
    Ember.run(App, 'destroy');
  }
});

test('visiting /foo', function() {
  visit('/foo');

  andThen(function() {
    equal(currentPath(), 'foo');
  });
});

@@ -0,0 +1,20 @@
import startApp from '../helpers/start-app';
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to import Ember from 'ember';.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot. Looks like the blueprint for tests/.jshintrc isn’t strict enough.

@rwjblue
Copy link
Member

rwjblue commented Jun 11, 2014

👍

@rwjblue
Copy link
Member

rwjblue commented Jun 11, 2014

Will need a CHANGELOG entry also.

jgwhite added a commit to jgwhite/ember-cli that referenced this pull request Jun 11, 2014
@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 11, 2014

Done and done 😄

it('integration-test foo', function() {
return generate(['integration-test', 'foo']).then(function() {
assertFile('tests/integration/foo-test.js', {
contains: "import Ember from 'ember';\n" +
Copy link
Contributor

Choose a reason for hiding this comment

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

its often nice to have assertFileEquals(inputFile, expectedFile) this prevents us from having long strings in tests, that are hard to maintain. Those files can live in fixtures/<test-name>/<files>

twokul added a commit that referenced this pull request Jun 12, 2014
@twokul twokul merged commit a5e56ef into ember-cli:master Jun 12, 2014
@jgwhite jgwhite deleted the integration-test-blueprint branch June 15, 2014 16:05
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