FEATURE: Export topics to markdown (#15615)

* FEATURE: Export topics to markdown

The route `/raw/TOPIC_ID` will now export whole topics (paginated to 100
posts) in a markdown format.

See https://meta.discourse.org/t/-/152185/12
This commit is contained in:
Rafael dos Santos Silva
2022-01-17 18:05:14 -03:00
committed by GitHub
parent 2909b8b820
commit 3f91c8835b
2 changed files with 28 additions and 1 deletions

View File

@ -1888,6 +1888,16 @@ describe PostsController do
expect(response.status).to eq(200)
expect(response.body).to eq("123456789")
end
it "can show whole topics" do
topic = Fabricate(:topic)
post = Fabricate(:post, topic: topic, post_number: 1, raw: "123456789")
post_2 = Fabricate(:post, topic: topic, post_number: 2, raw: "abcdefghij")
post.save
get "/raw/#{topic.id}"
expect(response.status).to eq(200)
expect(response.body).to include("123456789", "abcdefghij")
end
end
describe '#short_link' do