about summary refs log tree commit diff
path: root/spec/controllers/settings/pictures_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/settings/pictures_controller_spec.rb')
-rw-r--r--spec/controllers/settings/pictures_controller_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/controllers/settings/pictures_controller_spec.rb b/spec/controllers/settings/pictures_controller_spec.rb
new file mode 100644
index 000000000..2368dc55d
--- /dev/null
+++ b/spec/controllers/settings/pictures_controller_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Settings::PicturesController do
+  render_views
+
+  let!(:user) { Fabricate(:user) }
+
+  before do
+    sign_in user, scope: :user
+  end
+
+  describe 'DELETE #destroy' do
+    context 'with invalid picture id' do
+      it 'returns http bad request' do
+        delete :destroy, params: { id: 'invalid' }
+        expect(response).to have_http_status(400)
+      end
+    end
+  end
+end