From 7da10c01490e2b7ac9055216830dc3d37acad3bf Mon Sep 17 00:00:00 2001 From: Wojciech Zawistowski Date: Wed, 18 Sep 2013 18:40:57 +0200 Subject: [PATCH] Remove duplicate mixing in of Discourse.Presence AdminEmailIndexController and AdminEmailPreviewDigestController explicitely mix in Discourse.Presence, but they extend base classes Discourse.Controller and Discourse.ObjectController that already mix in Discourse.Presence, so this explicit inclusion is redundant. --- .../admin/controllers/admin_email_index_controller.js | 2 +- .../controllers/admin_email_preview_digest_controller.js | 2 +- .../controllers/admin_email_index_controller_test.js | 5 +++++ .../admin_email_preview_digest_controller_test.js | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 test/javascripts/controllers/admin_email_index_controller_test.js create mode 100644 test/javascripts/controllers/admin_email_preview_digest_controller_test.js diff --git a/app/assets/javascripts/admin/controllers/admin_email_index_controller.js b/app/assets/javascripts/admin/controllers/admin_email_index_controller.js index 673411d8ea2..8da9fa2d493 100644 --- a/app/assets/javascripts/admin/controllers/admin_email_index_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_email_index_controller.js @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.AdminEmailIndexController = Discourse.Controller.extend(Discourse.Presence, { +Discourse.AdminEmailIndexController = Discourse.Controller.extend({ /** Is the "send test email" button disabled? diff --git a/app/assets/javascripts/admin/controllers/admin_email_preview_digest_controller.js b/app/assets/javascripts/admin/controllers/admin_email_preview_digest_controller.js index 39de14ae996..eb54d21c6fb 100644 --- a/app/assets/javascripts/admin/controllers/admin_email_preview_digest_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_email_preview_digest_controller.js @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.AdminEmailPreviewDigestController = Discourse.ObjectController.extend(Discourse.Presence, { +Discourse.AdminEmailPreviewDigestController = Discourse.ObjectController.extend({ refresh: function() { var model = this.get('model'); diff --git a/test/javascripts/controllers/admin_email_index_controller_test.js b/test/javascripts/controllers/admin_email_index_controller_test.js new file mode 100644 index 00000000000..a5330b3186c --- /dev/null +++ b/test/javascripts/controllers/admin_email_index_controller_test.js @@ -0,0 +1,5 @@ +module("Discourse.AdminEmailIndexController"); + +test("mixes in Discourse.Presence", function() { + ok(Discourse.Presence.detect(Discourse.AdminEmailIndexController.create())); +}); diff --git a/test/javascripts/controllers/admin_email_preview_digest_controller_test.js b/test/javascripts/controllers/admin_email_preview_digest_controller_test.js new file mode 100644 index 00000000000..606caba5ad9 --- /dev/null +++ b/test/javascripts/controllers/admin_email_preview_digest_controller_test.js @@ -0,0 +1,5 @@ +module("Discourse.AdminEmailPreviewDigestController"); + +test("mixes in Discourse.Presence", function() { + ok(Discourse.Presence.detect(Discourse.AdminEmailPreviewDigestController.create())); +});