This repository has been archived on 2023-07-01. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/spec/models/concerns/account_interactions_spec.rb

39 lines
932 B
Ruby
Raw Normal View History

require 'rails_helper'
describe AccountInteractions do
2017-09-14 03:44:38 +02:00
describe 'muting an account' do
let(:me) { Fabricate(:account, username: 'Me') }
let(:you) { Fabricate(:account, username: 'You') }
2017-09-14 03:44:38 +02:00
context 'with the notifications option unspecified' do
before do
me.mute!(you)
2017-09-14 03:44:38 +02:00
end
2017-09-14 03:44:38 +02:00
it 'defaults to muting notifications' do
expect(me.muting_notifications?(you)).to be true
2017-09-14 03:44:38 +02:00
end
end
2017-09-14 03:44:38 +02:00
context 'with the notifications option set to false' do
before do
me.mute!(you, notifications: false)
2017-09-14 03:44:38 +02:00
end
2017-09-14 03:44:38 +02:00
it 'does not mute notifications' do
expect(me.muting_notifications?(you)).to be false
2017-09-14 03:44:38 +02:00
end
end
2017-09-14 03:44:38 +02:00
context 'with the notifications option set to true' do
before do
me.mute!(you, notifications: true)
2017-09-14 03:44:38 +02:00
end
2017-09-14 03:44:38 +02:00
it 'does mute notifications' do
expect(me.muting_notifications?(you)).to be true
2017-09-14 03:44:38 +02:00
end
end
end
end