DEV: Fix lint and clean-up tests.

DEV: Fix lint and clean-up tests.

diff --git a/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6 b/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6
index d866edb..79b6ed6 100644
--- a/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6
+++ b/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6
@@ -1,4 +1,3 @@
-import computed from "ember-addons/ember-computed-decorators";
 import {
   ENCRYPT_ACTIVE,
   getEncryptionStatus
diff --git a/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6 b/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6
index 322a704..ca8cc5c 100644
--- a/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6
+++ b/assets/javascripts/discourse/initializers/hook-decrypt-topic.js.es6
@@ -53,7 +53,10 @@ function decryptElements(containerSelector, elementSelector) {
  */
 export function decryptTitles() {
   decryptElements("h1[data-topic-id]", ".fancy-title");
-  decryptElements(".topic-list-item[data-topic-id], .latest-topic-list-item[data-topic-id]", ".title");
+  decryptElements(
+    ".topic-list-item[data-topic-id], .latest-topic-list-item[data-topic-id]",
+    ".title"
+  );
   decryptElements("a.topic-link[data-topic-id]", "span");
   decryptElements("a.topic-link[data-topic-id]");
   decryptElements("a.raw-topic-link[data-topic-id]");
diff --git a/assets/javascripts/discourse/initializers/hook-invite.js.es6 b/assets/javascripts/discourse/initializers/hook-invite.js.es6
index a3d0243..d753d93 100644
--- a/assets/javascripts/discourse/initializers/hook-invite.js.es6
+++ b/assets/javascripts/discourse/initializers/hook-invite.js.es6
@@ -7,7 +7,7 @@ import {
 import {
   ENCRYPT_ACTIVE,
   getEncryptionStatus,
-  hasTopicKey,
+  hasTopicKey
 } from "discourse/plugins/discourse-encrypt/lib/discourse";
 import { getTopicKey } from "discourse/plugins/discourse-encrypt/lib/discourse";
 
diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb
index efa93e3..6bd195e 100644
--- a/spec/models/post_spec.rb
+++ b/spec/models/post_spec.rb
@@ -25,12 +25,10 @@ describe Post do
     revisor.revise!(user, raw: 'this post is unencrypted and has been edited')
   end
 
-  it 'hides version for encrypted posts' do
-    expect(post.version).to eq(1)
-    expect(post.public_version).to eq(1)
-
-    expect(post2.version).to eq(2)
-    expect(post2.public_version).to eq(2)
+  context '#is_encrypted?' do
+    it 'works' do
+      expect(post.is_encrypted?).to eq(true)
+    end
   end
 
 end
diff --git a/spec/requests/encrypt_controller_spec.rb b/spec/requests/encrypt_controller_spec.rb
index 1a34a7b..d8ff7dc 100644
--- a/spec/requests/encrypt_controller_spec.rb
+++ b/spec/requests/encrypt_controller_spec.rb
@@ -139,126 +139,6 @@ describe ::DiscourseEncrypt::EncryptController do
     end
   end
 
-  context '#update_topic' do
-    it 'does not work when not logged in' do
-      put '/encrypt/topic', params: {
-        topic_id: topic.id,
-        title: '-- other encrypted title --',
-        keys: {
-          user.username => '-- other key of user --',
-          user2.username => '-- other key of user2 --'
-        }
-      }
-
-      expect(response.status).to eq(403)
-      expect(topic.custom_fields['encrypted_title']).to eq('-- the encrypted title --')
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- the key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-    end
-
-    it 'does not work for users who cannot see topic' do
-      sign_in(user3)
-
-      put '/encrypt/topic', params: {
-        topic_id: topic.id,
-        title: '-- other encrypted title --',
-        keys: {
-          user.username => '-- other key of user --',
-          user2.username => '-- other key of user2 --'
-        }
-      }
-
-      expect(response.status).to eq(403)
-      expect(topic.custom_fields['encrypted_title']).to eq('-- the encrypted title --')
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- the key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-    end
-
-    it 'saves encrypted topic data' do
-      sign_in(user)
-
-      put '/encrypt/topic', params: {
-        topic_id: other_topic.id,
-        title: '-- other encrypted title --',
-        keys: {
-          user.username => '-- other key of user --',
-          user2.username => '-- other key of user2 --'
-        }
-      }
-
-      expect(response.status).to eq(200)
-      expect(other_topic.custom_fields['encrypted_title']).to eq('-- other encrypted title --')
-      expect(store.get("key_#{other_topic.id}_#{user.id}")).to eq('-- other key of user --')
-      expect(store.get("key_#{other_topic.id}_#{user2.id}")).to eq('-- other key of user2 --')
-    end
-
-    it 'saves encrypted topic title' do
-      sign_in(user)
-
-      put '/encrypt/topic', params: {
-        topic_id: topic.id,
-        title: '-- new encrypted title --',
-      }
-
-      topic.reload
-
-      expect(response.status).to eq(200)
-      expect(topic.custom_fields['encrypted_title']).to eq('-- new encrypted title --')
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- the key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-    end
-
-    it 'saves encrypted topic key for each user' do
-      sign_in(user)
-
-      put '/encrypt/topic', params: {
-        topic_id: topic.id,
-        keys: {
-          user.username => '-- new key of user --',
-          user2.username => '-- new key of user2 --'
-        }
-      }
-
-      expect(response.status).to eq(200)
-      expect(topic.custom_fields['encrypted_title']).to eq('-- the encrypted title --')
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- new key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- new key of user2 --')
-    end
-  end
-
-  context '#destroy_topic' do
-    it 'does not work when not logged in' do
-      delete '/encrypt/topic', params: { topic_id: topic.id, usernames: [ user.username ] }
-
-      expect(response.status).to eq(403)
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- the key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-    end
-
-    it 'does not work for users who cannot see topic' do
-      sign_in(user3)
-
-      delete '/encrypt/topic', params: { topic_id: topic.id, usernames: [ user.username ] }
-
-      expect(response.status).to eq(403)
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- the key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-    end
-
-    it 'deletes topic keys' do
-      sign_in(user)
-
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq('-- the key of user --')
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-
-      delete '/encrypt/topic', params: { topic_id: topic.id, usernames: [ user.username ] }
-
-      expect(response.status).to eq(200)
-      expect(store.get("key_#{topic.id}_#{user.id}")).to eq(nil)
-      expect(store.get("key_#{topic.id}_#{user2.id}")).to eq('-- the key of user2 --')
-    end
-  end
-
   context '#reset_user' do
     before do
       user.custom_fields['encrypt_public_key']  = '-- the public key --'
diff --git a/test/javascripts/acceptance/encrypt-test.js.es6 b/test/javascripts/acceptance/encrypt-test.js.es6
index 17490c3..6ea845b 100644
--- a/test/javascripts/acceptance/encrypt-test.js.es6
+++ b/test/javascripts/acceptance/encrypt-test.js.es6
@@ -160,10 +160,6 @@ test("posting does not leak plaintext", async assert => {
   await setEncryptionStatus(ENCRYPT_ACTIVE);
 
   globalAssert = assert;
-  /* global server */
-  server.put("/encrypt/topic", () => {
-    return [200, { "Content-Type": "application/json" }, { success: "OK" }];
-  });
 

[... diff too long, it was truncated ...]

GitHub sha: 441d9bc6