2017-07-27 23:00:29 +09:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe AccountInteractions do
|
2017-09-14 10:44:38 +09:00
|
|
|
describe 'muting an account' do
|
|
|
|
before do
|
|
|
|
@me = Fabricate(:account, username: 'Me')
|
|
|
|
@you = Fabricate(:account, username: 'You')
|
|
|
|
end
|
2017-07-27 23:00:29 +09:00
|
|
|
|
2017-09-14 10:44:38 +09:00
|
|
|
context 'with the notifications option unspecified' do
|
|
|
|
before do
|
|
|
|
@me.mute!(@you)
|
|
|
|
end
|
2017-07-27 23:00:29 +09:00
|
|
|
|
2017-09-14 10:44:38 +09:00
|
|
|
it 'defaults to muting notifications' do
|
|
|
|
expect(@me.muting_notifications?(@you)).to be(true)
|
|
|
|
end
|
|
|
|
end
|
2017-07-27 23:00:29 +09:00
|
|
|
|
2017-09-14 10:44:38 +09:00
|
|
|
context 'with the notifications option set to false' do
|
|
|
|
before do
|
|
|
|
@me.mute!(@you, notifications: false)
|
|
|
|
end
|
2017-07-27 23:00:29 +09:00
|
|
|
|
2017-09-14 10:44:38 +09:00
|
|
|
it 'does not mute notifications' do
|
|
|
|
expect(@me.muting_notifications?(@you)).to be(false)
|
|
|
|
end
|
|
|
|
end
|
2017-07-27 23:00:29 +09:00
|
|
|
|
2017-09-14 10:44:38 +09:00
|
|
|
context 'with the notifications option set to true' do
|
|
|
|
before do
|
|
|
|
@me.mute!(@you, notifications: true)
|
|
|
|
end
|
2017-07-27 23:00:29 +09:00
|
|
|
|
2017-09-14 10:44:38 +09:00
|
|
|
it 'does mute notifications' do
|
|
|
|
expect(@me.muting_notifications?(@you)).to be(true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|