mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Merge pull request #3080 from riking/misc
Miscellaneous fixes from PR#3000
This commit is contained in:
@ -799,4 +799,26 @@ describe PostsController do
|
||||
|
||||
end
|
||||
|
||||
describe "view raw" do
|
||||
describe "by ID" do
|
||||
it "can be viewed by anonymous" do
|
||||
post = Fabricate(:post, raw: "123456789")
|
||||
xhr :get, :markdown_id, id: post.id
|
||||
response.should be_success
|
||||
response.body.should == "123456789"
|
||||
end
|
||||
end
|
||||
|
||||
describe "by post number" do
|
||||
it "can be viewed by anonymous" do
|
||||
topic = Fabricate(:topic)
|
||||
post = Fabricate(:post, topic: topic, post_number: 1, raw: "123456789")
|
||||
post.save
|
||||
xhr :get, :markdown_num, topic_id: topic.id, post_number: 1
|
||||
response.should be_success
|
||||
response.body.should == "123456789"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user