diff --git a/.jshintrc b/.jshintrc index 08096eff..45569263 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,7 +2,8 @@ "predef": [ "document", "window", - "-Promise" + "-Promise", + "jQuery" ], "browser": true, "boss": true, diff --git a/app/utils/helpers.coffee b/app/utils/helpers.coffee index 0bc38926..52d7bb0d 100644 --- a/app/utils/helpers.coffee +++ b/app/utils/helpers.coffee @@ -2,6 +2,7 @@ `import { githubCommit as githubCommitUrl } from 'travis/utils/urls'` `import configKeysMap from 'travis/utils/keys-map'` `import config from 'travis/config/environment'` +`import Ember from 'ember'` timeago = $.timeago mapObject = $.map @@ -66,9 +67,9 @@ formatMessage = (message, options) -> message = message || '' message = message.split(/\n/)[0] if options.short message = _emojize(_escape(message)) - if !!options.repo - message = githubify(message, options.repo.get('owner'), options.repo.get('name')) - if !!options.pre + if options.repo + message = githubify(message, Ember.get(options.repo, 'owner'), Ember.get(options.repo, 'name')) + if options.pre message = message.replace /\n/g, '
' message diff --git a/tests/.jshintrc b/tests/.jshintrc index 6ebf71a0..618a5861 100644 --- a/tests/.jshintrc +++ b/tests/.jshintrc @@ -44,7 +44,8 @@ "andThen", "currentURL", "currentPath", - "currentRouteName" + "currentRouteName", + "jQuery" ], "node": false, "browser": false, diff --git a/tests/integration/components/add-env-var-test.js b/tests/integration/components/add-env-var-test.js index d138fe54..66963000 100644 --- a/tests/integration/components/add-env-var-test.js +++ b/tests/integration/components/add-env-var-test.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; @@ -22,12 +23,12 @@ test('it adds an env var on submit', function(assert) { this.render(hbs`{{add-env-var repo=repo}}`); this.$('.env-name').val('FOO'); - var e = jQuery.Event("keyup"); + var e = $.Event("keyup"); e.which = 50; this.$('.env-name').trigger(e); this.$('.env-value').val('bar'); - var e = jQuery.Event("keyup"); + e = $.Event("keyup"); e.which = 50; this.$('.env-value').trigger(e); @@ -54,7 +55,7 @@ test('it shows an error if no name is present', function(assert) { assert.ok(this.$('.form-error-message').length, 'the error message should be displayed'); - var e = jQuery.Event("keypress"); + var e = $.Event("keypress"); e.which = 50; this.$('.env-name').trigger(e); diff --git a/tests/unit/components/builds-item-test.coffee b/tests/unit/components/builds-item-test.coffee index 8578e522..b4496a79 100644 --- a/tests/unit/components/builds-item-test.coffee +++ b/tests/unit/components/builds-item-test.coffee @@ -25,7 +25,9 @@ test 'it renders', (assert) -> slug: 'foo/bar' } } - component = @subject(build: attributes) + + component = @subject() + component.set('build', attributes) @append() ok component.$().hasClass('passed'), 'component has right status class'