about summary refs log tree commit diff
path: root/spec/controllers/admin/reported_statuses_controller_spec.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-05-05 23:06:29 +0200
committerGitHub <noreply@github.com>2018-05-05 23:06:29 +0200
commitc7d1a2e400cd6677057a8af90fff866207576098 (patch)
treedf1790bcb483f66c552bc39de116aab85b49d45c /spec/controllers/admin/reported_statuses_controller_spec.rb
parent660db468c09146802bd4418599cf4103ef190c10 (diff)
Improve admin UI for accounts (#7360)
* Improve design of account statuses admin UI (consistent with reports)

* Make account moderation notes look consistent with report notes

* i18n-tasks remove-unused

* Fix code style issues

* Fix tests
Diffstat (limited to 'spec/controllers/admin/reported_statuses_controller_spec.rb')
-rw-r--r--spec/controllers/admin/reported_statuses_controller_spec.rb49
1 files changed, 8 insertions, 41 deletions
diff --git a/spec/controllers/admin/reported_statuses_controller_spec.rb b/spec/controllers/admin/reported_statuses_controller_spec.rb
index 29957ed37..7adbf36b9 100644
--- a/spec/controllers/admin/reported_statuses_controller_spec.rb
+++ b/spec/controllers/admin/reported_statuses_controller_spec.rb
@@ -22,7 +22,7 @@ describe Admin::ReportedStatusesController do
     let(:sensitive) { true }
     let!(:media_attachment) { Fabricate(:media_attachment, status: status) }
 
-    context 'updates sensitive column to true' do
+    context 'when action is nsfw_on' do
       it 'updates sensitive column' do
         is_expected.to change {
           status.reload.sensitive
@@ -30,7 +30,7 @@ describe Admin::ReportedStatusesController do
       end
     end
 
-    context 'updates sensitive column to false' do
+    context 'when action is nsfw_off' do
       let(:action) { 'nsfw_off' }
       let(:sensitive) { false }
 
@@ -41,35 +41,13 @@ describe Admin::ReportedStatusesController do
       end
     end
 
-    it 'redirects to report page' do
-      subject.call
-      expect(response).to redirect_to(admin_report_path(report))
-    end
-  end
-
-  describe 'PATCH #update' do
-    subject do
-      -> { patch :update, params: { report_id: report, id: status, status: { sensitive: sensitive } } }
-    end
-
-    let(:status) { Fabricate(:status, sensitive: !sensitive) }
-    let(:sensitive) { true }
-
-    context 'updates sensitive column to true' do
-      it 'updates sensitive column' do
-        is_expected.to change {
-          status.reload.sensitive
-        }.from(false).to(true)
-      end
-    end
+    context 'when action is delete' do
+      let(:action) { 'delete' }
 
-    context 'updates sensitive column to false' do
-      let(:sensitive) { false }
-
-      it 'updates sensitive column' do
-        is_expected.to change {
-          status.reload.sensitive
-        }.from(true).to(false)
+      it 'removes a status' do
+        allow(RemovalWorker).to receive(:perform_async)
+        subject.call
+        expect(RemovalWorker).to have_received(:perform_async).with(status_ids.first)
       end
     end
 
@@ -78,15 +56,4 @@ describe Admin::ReportedStatusesController do
       expect(response).to redirect_to(admin_report_path(report))
     end
   end
-
-  describe 'DELETE #destroy' do
-    it 'removes a status' do
-      allow(RemovalWorker).to receive(:perform_async)
-
-      delete :destroy, params: { report_id: report, id: status }
-      expect(response).to have_http_status(200)
-      expect(RemovalWorker).
-        to have_received(:perform_async).with(status.id)
-    end
-  end
 end