2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-12 21:10:47 +08:00

FIX: Validations could prevent moving posts

This commit is contained in:
Gerhard Schlager 2018-02-08 13:36:13 +01:00
parent 8ab6689f43
commit 0ecdf90023
2 changed files with 13 additions and 1 deletions

View file

@ -499,6 +499,17 @@ describe PostMover do
end
end

it "skips validations when moving posts" do
p1.update_attribute(:raw, "foo")
p2.update_attribute(:raw, "bar")

new_topic = topic.move_posts(user, [p1.id, p2.id], title: "new testing topic name")

expect(new_topic).to be_present
expect(new_topic.posts.by_post_number.first.raw).to eq(p1.raw)
expect(new_topic.posts.by_post_number.last.raw).to eq(p2.raw)
expect(new_topic.posts_count).to eq(2)
end
end
end
end