1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Improve coverage specificity for Webhook enable/disable/secret specs

This commit is contained in:
Matt Jankowski 2024-07-29 12:01:17 -04:00
parent 6d2ed0dcba
commit 37ecb31e17

View file

@ -38,28 +38,28 @@ RSpec.describe Webhook do
describe '#rotate_secret!' do describe '#rotate_secret!' do
it 'changes the secret' do it 'changes the secret' do
previous_value = webhook.secret expect { webhook.rotate_secret! }
webhook.rotate_secret! .to change(webhook, :secret)
expect(webhook.secret).to_not be_blank expect(webhook.secret)
expect(webhook.secret).to_not eq previous_value .to_not be_blank
end end
end end
describe '#enable!' do describe '#enable!' do
before do let(:webhook) { Fabricate(:webhook, enabled: false) }
webhook.disable!
end
it 'enables the webhook' do it 'enables the webhook' do
webhook.enable! expect { webhook.enable! }
expect(webhook.enabled?).to be true .to change(webhook, :enabled?).to(true)
end end
end end
describe '#disable!' do describe '#disable!' do
let(:webhook) { Fabricate(:webhook, enabled: true) }
it 'disables the webhook' do it 'disables the webhook' do
webhook.disable! expect { webhook.disable! }
expect(webhook.enabled?).to be false .to change(webhook, :enabled?).to(false)
end end
end end
end end