specs for MuteService notifications params

main
Surinna Curtis 2017-08-06 20:13:12 -03:00
parent 2ea9b164d3
commit 500c465226
1 changed files with 32 additions and 0 deletions

View File

@ -32,4 +32,36 @@ RSpec.describe MuteService do
account.muting?(target_account) account.muting?(target_account)
}.from(false).to(true) }.from(false).to(true)
end end
context 'without specifying a notifications parameter' do
it 'mutes notifications from the account' do
is_expected.to change {
account.muting_notifications?(target_account)
}.from(false).to(true)
end
end
context 'with a true notifications parameter' do
subject do
-> { described_class.new.call(account, target_account, notifications: true) }
end
it 'mutes notifications from the account' do
is_expected.to change {
account.muting_notifications?(target_account)
}.from(false).to(true)
end
end
context 'with a false notifications parameter' do
subject do
-> { described_class.new.call(account, target_account, notifications: false) }
end
it 'does not mute notifications from the account' do
is_expected.to_not change {
account.muting_notifications?(target_account)
}.from(false)
end
end
end end