mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Miscellaneous fixes from PR#3000
FIX: Don't require login to view post raw FIX: Don't submit read-guidelines for anonymous users (causes unnecessary 403 errors from ensure_logged_in) FIX: Don't pass nil to an array serializer
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