mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 11:25:24 +00:00
Fix the build.
This commit is contained in:
parent
10bc69a62f
commit
5374a0e720
@ -912,8 +912,14 @@ class Topic < ActiveRecord::Base
|
||||
post_mover = PostMover.new(self, moved_by, post_ids)
|
||||
|
||||
if opts[:destination_topic_id]
|
||||
post_mover.to_topic opts[:destination_topic_id]
|
||||
DiscourseEvent.trigger(:topic_merged, post_mover.original_topic, post_mover.destination_topic)
|
||||
topic = post_mover.to_topic(opts[:destination_topic_id])
|
||||
|
||||
DiscourseEvent.trigger(:topic_merged,
|
||||
post_mover.original_topic,
|
||||
post_mover.destination_topic
|
||||
)
|
||||
|
||||
topic
|
||||
elsif opts[:title]
|
||||
post_mover.to_new_topic(opts[:title], opts[:category_id], opts[:tags])
|
||||
end
|
||||
|
@ -201,11 +201,11 @@ RSpec.describe TopicsController do
|
||||
expect(result['success']).to eq(true)
|
||||
expect(result['url']).to be_present
|
||||
end
|
||||
|
||||
|
||||
it "triggers an event on merge" do
|
||||
DiscourseEvent.on(:topic_merged) do |original_topic, destination_topic|
|
||||
expect(original_topic.id).to eq(topic.id)
|
||||
expect(destination_topic.id).to eq(dest_topic.id)
|
||||
expect(original_topic).to eq(topic)
|
||||
expect(destination_topic).to eq(dest_topic)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user