feat: Ability to unmute muted conversations (#1319)

This commit is contained in:
Dmitriy Shcherbakan 2020-10-08 09:32:08 +03:00 committed by GitHub
parent 2aad33a5be
commit ecebe163e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 242 additions and 0 deletions

View file

@ -289,6 +289,22 @@ RSpec.describe Conversation, type: :model do
end
end
describe '#unmute!' do
subject(:unmute!) { conversation.unmute! }
let(:conversation) { create(:conversation).tap(&:mute!) }
it 'does not change conversation status' do
expect { unmute! }.not_to(change { conversation.reload.status })
end
it 'marks conversation as muted in redis' do
expect { unmute! }
.to change { Redis::Alfred.get(conversation.send(:mute_key)) }
.to nil
end
end
describe '#muted?' do
subject(:muted?) { conversation.muted? }