FIX: Copy custom fields when moving first post of a topic.

https://meta.discourse.org/t/transfer-poll-votes-when-moving-a-topic-into-an-existing-one/63678
This commit is contained in:
Guo Xiang Tan
2017-06-07 19:04:48 +09:00
parent 860a7e1fc0
commit 5794ff53a1
2 changed files with 13 additions and 0 deletions

View File

@ -342,6 +342,16 @@ describe PostMover do
expect(new_post.post_actions.size).to eq(1)
end
it "preserves the custom_fields in the new post" do
custom_fields = { "some_field" => 'payload' }
p1.custom_fields = custom_fields
p1.save_custom_fields
new_topic = topic.move_posts(user, [p1.id], title: "new testing topic name")
expect(new_topic.first_post.custom_fields).to eq(custom_fields)
end
end
context "to an existing topic with a deleted post" do