diff --git a/app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 b/app/assets/javascripts/discourse/controllers/bulk_notification_level_controller.js similarity index 93% rename from app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 rename to app/assets/javascripts/discourse/controllers/bulk_notification_level_controller.js index 87d698062..444165baf 100644 --- a/app/assets/javascripts/discourse/controllers/bulk-notification-level.js.es6 +++ b/app/assets/javascripts/discourse/controllers/bulk_notification_level_controller.js @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -export default Em.Controller.extend({ +Discourse.BulkNotificationLevelController = Em.Controller.extend({ needs: ['topicBulkActions'], notificationLevelId: null, diff --git a/app/assets/javascripts/discourse/controllers/change-owner.js.es6 b/app/assets/javascripts/discourse/controllers/change_owner_controller.js similarity index 92% rename from app/assets/javascripts/discourse/controllers/change-owner.js.es6 rename to app/assets/javascripts/discourse/controllers/change_owner_controller.js index 46b042898..865a5c910 100644 --- a/app/assets/javascripts/discourse/controllers/change-owner.js.es6 +++ b/app/assets/javascripts/discourse/controllers/change_owner_controller.js @@ -7,7 +7,7 @@ @uses Discourse.ModalFunctionality @module Discourse **/ -export default Discourse.ObjectController.extend(Discourse.SelectedPostsCount, Discourse.ModalFunctionality, { +Discourse.ChangeOwnerController = Discourse.ObjectController.extend(Discourse.SelectedPostsCount, Discourse.ModalFunctionality, { needs: ['topic'], topicController: Em.computed.alias('controllers.topic'), diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer_controller.js similarity index 99% rename from app/assets/javascripts/discourse/controllers/composer.js.es6 rename to app/assets/javascripts/discourse/controllers/composer_controller.js index 486b851eb..a64100810 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -export default Discourse.Controller.extend({ +Discourse.ComposerController = Discourse.Controller.extend({ needs: ['modal', 'topic', 'composerMessages'], replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY), diff --git a/app/assets/javascripts/discourse/controllers/composer-messages.js.es6 b/app/assets/javascripts/discourse/controllers/composer_messages_controller.js similarity index 96% rename from app/assets/javascripts/discourse/controllers/composer-messages.js.es6 rename to app/assets/javascripts/discourse/controllers/composer_messages_controller.js index d23ba6066..3dea0b416 100644 --- a/app/assets/javascripts/discourse/controllers/composer-messages.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer_messages_controller.js @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -export default Ember.ArrayController.extend({ +Discourse.ComposerMessagesController = Ember.ArrayController.extend({ needs: ['composer'], // Whether we've checked our messages @@ -98,4 +98,4 @@ export default Ember.ArrayController.extend({ }); } -}); +}); \ No newline at end of file diff --git a/app/assets/javascripts/discourse/controllers/create-account.js.es6 b/app/assets/javascripts/discourse/controllers/create_account_controller.js similarity index 99% rename from app/assets/javascripts/discourse/controllers/create-account.js.es6 rename to app/assets/javascripts/discourse/controllers/create_account_controller.js index dc76f058f..a04dc3c6c 100644 --- a/app/assets/javascripts/discourse/controllers/create-account.js.es6 +++ b/app/assets/javascripts/discourse/controllers/create_account_controller.js @@ -7,7 +7,7 @@ @uses Discourse.ModalFunctionality @module Discourse **/ -export default Discourse.Controller.extend(Discourse.ModalFunctionality, { +Discourse.CreateAccountController = Discourse.Controller.extend(Discourse.ModalFunctionality, { uniqueUsernameValidation: null, globalNicknameExists: false, complete: false, diff --git a/app/assets/javascripts/discourse/lib/url.js b/app/assets/javascripts/discourse/lib/url.js index 66cb168bb..0f096d2e5 100644 --- a/app/assets/javascripts/discourse/lib/url.js +++ b/app/assets/javascripts/discourse/lib/url.js @@ -52,8 +52,6 @@ Discourse.URL = Em.Object.createWithMixins({ **/ routeTo: function(path) { - if (Em.isEmpty(path)) { return; } - if(Discourse.get("requiresRefresh")){ document.location.href = path; return; diff --git a/test/javascripts/controllers/create_account_controller_test.js b/test/javascripts/controllers/create_account_controller_test.js index 45ca92ee8..8e6ced64c 100644 --- a/test/javascripts/controllers/create_account_controller_test.js +++ b/test/javascripts/controllers/create_account_controller_test.js @@ -1,8 +1,8 @@ -module("controller:create-account"); +module("Discourse.CreateAccountController"); test('basicUsernameValidation', function() { var testInvalidUsername = function(username, expectedReason) { - var controller = controllerFor('create-account'); + var controller = testController(Discourse.CreateAccountController, null); controller.set('accountUsername', username); equal(controller.get('basicUsernameValidation.failed'), true, 'username should be invalid: ' + username); equal(controller.get('basicUsernameValidation.reason'), expectedReason, 'username validation reason: ' + username + ', ' + expectedReason); @@ -12,7 +12,7 @@ test('basicUsernameValidation', function() { testInvalidUsername('x', I18n.t('user.username.too_short')); testInvalidUsername('1234567890123456', I18n.t('user.username.too_long')); - var controller = controllerFor('create-account'); + var controller = testController(Discourse.CreateAccountController, null); controller.set('accountUsername', 'porkchops'); controller.set('prefilledUsername', 'porkchops'); equal(controller.get('basicUsernameValidation.ok'), true, 'Prefilled username is valid');