mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #8736 from gschlager/rename_reply_id_column
REFACTOR: Rename `post_replies.reply_id` column to `post_replies.reply_post_id`
This commit is contained in:
@@ -639,7 +639,7 @@ describe PostDestroyer do
|
||||
describe 'with a reply' do
|
||||
|
||||
fab!(:reply) { Fabricate(:basic_reply, user: coding_horror, topic: post.topic) }
|
||||
let!(:post_reply) { PostReply.create(post_id: post.id, reply_id: reply.id) }
|
||||
let!(:post_reply) { PostReply.create(post_id: post.id, reply_post_id: reply.id) }
|
||||
|
||||
it 'changes the post count of the topic' do
|
||||
post.reload
|
||||
|
||||
@@ -955,10 +955,10 @@ describe PostMover do
|
||||
expect(topic.highest_post_number).to eq(p4.post_number)
|
||||
|
||||
# updates replies for posts moved to same topic
|
||||
expect(PostReply.where(reply_id: p2.id).pluck(:post_id)).to contain_exactly(new_first.id)
|
||||
expect(PostReply.where(reply_post_id: p2.id).pluck(:post_id)).to contain_exactly(new_first.id)
|
||||
|
||||
# leaves replies to the first post of the original topic unchanged
|
||||
expect(PostReply.where(reply_id: p3.id).pluck(:post_id)).to contain_exactly(p1.id)
|
||||
expect(PostReply.where(reply_post_id: p3.id).pluck(:post_id)).to contain_exactly(p1.id)
|
||||
end
|
||||
|
||||
it "preserves post actions in the new post" do
|
||||
|
||||
@@ -236,7 +236,7 @@ describe PostsController do
|
||||
|
||||
describe "can delete replies" do
|
||||
before do
|
||||
PostReply.create(post_id: post1.id, reply_id: post2.id)
|
||||
PostReply.create(post_id: post1.id, reply_post_id: post2.id)
|
||||
end
|
||||
|
||||
it "deletes the post and the reply to it" do
|
||||
|
||||
@@ -162,7 +162,7 @@ RSpec.describe TopicsController do
|
||||
user = sign_in(moderator)
|
||||
p1 = Fabricate(:post, topic: topic, user: user)
|
||||
p2 = Fabricate(:post, topic: topic, user: user, reply_to_post_number: p1.post_number)
|
||||
PostReply.create(post_id: p1.id, reply_id: p2.id)
|
||||
PostReply.create(post_id: p1.id, reply_post_id: p2.id)
|
||||
|
||||
post "/t/#{topic.id}/move-posts.json", params: {
|
||||
title: 'new topic title',
|
||||
|
||||
Reference in New Issue
Block a user