about summary refs log tree commit diff
path: root/spec/controllers/account_unfollow_controller_spec.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-10-28 11:36:25 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-10-28 19:23:58 +0200
commitcb19be67d1b47dd04cb5bb88e09f0101a614bd1c (patch)
tree6c85ccc6ac0279ae7b1ed4dff56c8e83f71a0c95 /spec/controllers/account_unfollow_controller_spec.rb
parent371563b0e249b6369e04709fb974a8e57413529f (diff)
parent8dfe5179ee7186e549dbe1186a151ffa848fe8ab (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'spec/controllers/account_unfollow_controller_spec.rb')
-rw-r--r--spec/controllers/account_unfollow_controller_spec.rb64
1 files changed, 0 insertions, 64 deletions
diff --git a/spec/controllers/account_unfollow_controller_spec.rb b/spec/controllers/account_unfollow_controller_spec.rb
deleted file mode 100644
index a11f7aa68..000000000
--- a/spec/controllers/account_unfollow_controller_spec.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'rails_helper'
-
-describe AccountUnfollowController do
-  render_views
-
-  let(:user) { Fabricate(:user) }
-  let(:alice) { Fabricate(:account, username: 'alice') }
-
-  describe 'POST #create' do
-    let(:service) { double }
-
-    subject { post :create, params: { account_username: alice.username } }
-
-    before do
-      allow(UnfollowService).to receive(:new).and_return(service)
-      allow(service).to receive(:call)
-    end
-
-    context 'when account is permanently suspended' do
-      before do
-        alice.suspend!
-        alice.deletion_request.destroy
-        subject
-      end
-
-      it 'returns http gone' do
-        expect(response).to have_http_status(410)
-      end
-    end
-
-    context 'when account is temporarily suspended' do
-      before do
-        alice.suspend!
-        subject
-      end
-
-      it 'returns http forbidden' do
-        expect(response).to have_http_status(403)
-      end
-    end
-
-    context 'when signed out' do
-      before do
-        subject
-      end
-
-      it 'does not unfollow' do
-        expect(UnfollowService).not_to receive(:new)
-      end
-    end
-
-    context 'when signed in' do
-      before do
-        sign_in(user)
-        subject
-      end
-
-      it 'redirects to account path' do
-        expect(service).to have_received(:call).with(user.account, alice)
-        expect(response).to redirect_to(account_path(alice))
-      end
-    end
-  end
-end