forum: remove ability to merge forum topics.
* Rarely used (only used ~15 times in total, not used at all since 2015-2016). * Merging topics didn't properly bump the new topic. * Merging topics didn't log a modaction when the old topic was deleted. * Merging topics broke the old topic. Moving all the posts from one topic to another leaves the old topic with zero posts. This normally can't happen and it causes exceptions when you try to view the empty topic. * It was technically possible to merge a topic with itself. This would break the response_count. * It was technically possible for a mod to merge a topic into an admin-only topic.
This commit is contained in:
@@ -111,19 +111,6 @@ class ForumTopicTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "#merge" do
|
||||
setup do
|
||||
@topic2 = create(:forum_topic, title: "yyy", creator: @user)
|
||||
FactoryBot.create(:forum_post, :topic_id => @topic.id, :body => "xxx")
|
||||
FactoryBot.create(:forum_post, :topic_id => @topic2.id, :body => "xxx")
|
||||
end
|
||||
|
||||
should "merge all the posts in one topic into the other" do
|
||||
@topic.merge(@topic2)
|
||||
assert_equal(2, @topic2.posts.count)
|
||||
end
|
||||
end
|
||||
|
||||
context "constructed with nested attributes for its original post" do
|
||||
should "create a matching forum post" do
|
||||
assert_difference(["ForumTopic.count", "ForumPost.count"], 1) do
|
||||
|
||||
Reference in New Issue
Block a user