Retrospring/spec/lib/use_case/mute_rule/destroy_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
422 B
Ruby
Raw Normal View History

2023-01-02 03:26:52 -08:00
# frozen_string_literal: true
require "rails_helper"
describe UseCase::MuteRule::Destroy do
subject { UseCase::MuteRule::Destroy.call(rule:) }
context "rule exists" do
let(:user) { FactoryBot.create(:user) }
let(:rule) { MuteRule.create(user:, muted_phrase: "test") }
it "deletes the mute rule" do
expect { subject }.to change { MuteRule.exists?(rule.id) }.from(true).to(false)
end
end
end