diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-01-11 11:55:42 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-01-11 11:55:42 +0100 |
commit | 33d30632fb627ba1742eff3e0c5fc84ccd156cdb (patch) | |
tree | b7c15bb354c9d2f0ef25c50ab387007703f599d6 /spec/controllers/api/v1 | |
parent | d42e7e01dcd464f80637682d4eee6e5a7f36f26e (diff) | |
parent | 11d603101a7b3389c679b8c155a3cb06203ca31a (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `app/models/public_feed.rb`: Upstream refactored a bit, glitch-soc had specific code for local-only statuses. Updated glitch-soc's specific code accordingly.
Diffstat (limited to 'spec/controllers/api/v1')
-rw-r--r-- | spec/controllers/api/v1/accounts_controller_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/accounts_controller_spec.rb b/spec/controllers/api/v1/accounts_controller_spec.rb index 1e656503f..d9ee37ffa 100644 --- a/spec/controllers/api/v1/accounts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts_controller_spec.rb @@ -268,6 +268,34 @@ RSpec.describe Api::V1::AccountsController, type: :controller do it_behaves_like 'forbidden for wrong scope', 'read:accounts' end + describe 'POST #mute with nonzero duration set' do + let(:scopes) { 'write:mutes' } + let(:other_account) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob')).account } + + before do + user.account.follow!(other_account) + post :mute, params: { id: other_account.id, duration: 300 } + end + + it 'returns http success' do + expect(response).to have_http_status(200) + end + + it 'does not remove the following relation between user and target user' do + expect(user.account.following?(other_account)).to be true + end + + it 'creates a muting relation' do + expect(user.account.muting?(other_account)).to be true + end + + it 'mutes notifications' do + expect(user.account.muting_notifications?(other_account)).to be true + end + + it_behaves_like 'forbidden for wrong scope', 'read:accounts' + end + describe 'POST #unmute' do let(:scopes) { 'write:mutes' } let(:other_account) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob')).account } |