mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add test to verify posts are moved in transaction
This commit is contained in:
parent
b8fbac582e
commit
1ba18318ac
@ -204,10 +204,15 @@ describe Topic do
|
|||||||
lambda { topic.move_posts(user, [1003], title: "new testing topic name") }.should raise_error(Discourse::InvalidParameters)
|
lambda { topic.move_posts(user, [1003], title: "new testing topic name") }.should raise_error(Discourse::InvalidParameters)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises an error if no posts were moved" do
|
it "raises an error and does not create a topic if no posts were moved" do
|
||||||
lambda { topic.move_posts(user, [], title: "new testing topic name") }.should raise_error(Discourse::InvalidParameters)
|
Topic.count.tap do |original_topic_count|
|
||||||
end
|
lambda {
|
||||||
|
topic.move_posts(user, [], title: "new testing topic name")
|
||||||
|
}.should raise_error(Discourse::InvalidParameters)
|
||||||
|
|
||||||
|
expect(Topic.count).to eq original_topic_count
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "successfully moved" do
|
context "successfully moved" do
|
||||||
|
Loading…
Reference in New Issue
Block a user