FEATURE: Navigate to an approved queued topic from the review queue. (#12841)

Admins can visit an approved queued topic from the review queue by clicking their title. We no longer store the created post and topic ids in the reviewable's payload object. Instead, we set the `topic_id` and `target_id` attributes.
This commit is contained in:
Roman Rizzi
2021-05-26 15:43:18 -03:00
committed by GitHub
parent 8e1448487f
commit 83dd47f0b4
3 changed files with 25 additions and 5 deletions

View File

@ -61,7 +61,7 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(result.created_post.custom_fields['hello']).to eq('world')
expect(result.created_post_topic).to eq(topic)
expect(result.created_post.user).to eq(reviewable.created_by)
expect(reviewable.payload['created_post_id']).to eq(result.created_post.id)
expect(reviewable.target_id).to eq(result.created_post.id)
expect(Topic.count).to eq(topic_count)
expect(Post.count).to eq(post_count + 1)
@ -183,8 +183,8 @@ RSpec.describe ReviewableQueuedPost, type: :model do
expect(result.created_post).to be_valid
expect(result.created_post_topic).to be_present
expect(result.created_post_topic).to be_valid
expect(reviewable.payload['created_post_id']).to eq(result.created_post.id)
expect(reviewable.payload['created_topic_id']).to eq(result.created_post_topic.id)
expect(reviewable.target_id).to eq(result.created_post.id)
expect(reviewable.topic_id).to eq(result.created_post_topic.id)
expect(Topic.count).to eq(topic_count + 1)
expect(Post.count).to eq(post_count + 1)