2017-11-15 02:56:41 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe AccountInteractions do
|
|
|
|
describe 'muting an account' do
|
|
|
|
let(:me) { Fabricate(:account, username: 'Me') }
|
|
|
|
let(:you) { Fabricate(:account, username: 'You') }
|
|
|
|
|
|
|
|
context 'with the notifications option unspecified' do
|
|
|
|
before do
|
|
|
|
me.mute!(you)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'defaults to muting notifications' do
|
|
|
|
expect(me.muting_notifications?(you)).to be true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with the notifications option set to false' do
|
|
|
|
before do
|
|
|
|
me.mute!(you, notifications: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not mute notifications' do
|
|
|
|
expect(me.muting_notifications?(you)).to be false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with the notifications option set to true' do
|
|
|
|
before do
|
|
|
|
me.mute!(you, notifications: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does mute notifications' do
|
2017-11-16 07:21:16 +00:00
|
|
|
expect(me.muting_notifications?(you)).to be true
|
2017-09-14 01:44:38 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-11-11 02:11:10 +00:00
|
|
|
|
|
|
|
describe 'ignoring reblogs from an account' do
|
|
|
|
before do
|
|
|
|
@me = Fabricate(:account, username: 'Me')
|
|
|
|
@you = Fabricate(:account, username: 'You')
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with the reblogs option unspecified' do
|
|
|
|
before do
|
|
|
|
@me.follow!(@you)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'defaults to showing reblogs' do
|
|
|
|
expect(@me.muting_reblogs?(@you)).to be(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with the reblogs option set to false' do
|
|
|
|
before do
|
|
|
|
@me.follow!(@you, reblogs: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does mute reblogs' do
|
|
|
|
expect(@me.muting_reblogs?(@you)).to be(true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with the reblogs option set to true' do
|
|
|
|
before do
|
|
|
|
@me.follow!(@you, reblogs: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not mute reblogs' do
|
|
|
|
expect(@me.muting_reblogs?(@you)).to be(false)
|
2017-11-15 02:56:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|