Skip to content

Commit

Permalink
DEV: removing create post for category and tag changes setting (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grubba27 authored Aug 13, 2024
1 parent 57b4607 commit 35925c4
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions spec/services/manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,38 +316,6 @@
expect(provider.sent_to_channel_ids).to contain_exactly(chan1.id)
end

describe "With `create_post_for_category_and_tag_changes` enabled" do
before(:each) { SiteSetting.create_post_for_category_and_tag_changes = true }

let(:admin) { Fabricate(:admin) }
let(:other_topic) { Fabricate(:topic) }
let(:other_topic_post) { Fabricate(:post, topic: topic) }

it "should trigger follow rules for specific categories when topic category changes" do
DiscourseChatIntegration::Rule.create!(
channel: chan1,
filter: "follow",
category_id: category.id,
)

PostRevisor.new(other_topic_post).revise!(admin, category_id: category.id)

manager.trigger_notifications(topic.ordered_posts.last.id)

expect(provider.sent_to_channel_ids).to contain_exactly(chan1.id)
end

it "shouldn't trigger follow rules with wildcard category match" do
DiscourseChatIntegration::Rule.create!(channel: chan1, filter: "follow", category_id: nil)

PostRevisor.new(other_topic_post).revise!(admin, category_id: category.id)

manager.trigger_notifications(topic.ordered_posts.last.id)

expect(provider.sent_to_channel_ids).to contain_exactly
end
end

describe "with tags enabled" do
let(:tag) { Fabricate(:tag, name: "gsoc") }
let(:tagged_topic) { Fabricate(:topic, category_id: category.id, tags: [tag]) }
Expand Down

0 comments on commit 35925c4

Please sign in to comment.