mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 12:24:32 +08:00
Trust level 4: add ability to edit any post and see edit history
This commit is contained in:
@ -431,7 +431,13 @@ describe PostsController do
|
||||
|
||||
before { SiteSetting.stubs(:edit_history_visible_to_public).returns(false) }
|
||||
|
||||
it "ensures anonymous can not see the revisions" do
|
||||
it "ensures anonymous cannot see the revisions" do
|
||||
xhr :get, :revisions, post_id: post_revision.post_id, revision: post_revision.number
|
||||
response.should be_forbidden
|
||||
end
|
||||
|
||||
it "ensures regular user cannot see the revisions" do
|
||||
u = log_in(:user)
|
||||
xhr :get, :revisions, post_id: post_revision.post_id, revision: post_revision.number
|
||||
response.should be_forbidden
|
||||
end
|
||||
@ -444,11 +450,18 @@ describe PostsController do
|
||||
|
||||
it "ensures poster can see the revisions" do
|
||||
user = log_in(:active_user)
|
||||
pr = Fabricate(:post_revision, user: user)
|
||||
post = Fabricate(:post, user: user)
|
||||
pr = Fabricate(:post_revision, user: user, post: post)
|
||||
xhr :get, :revisions, post_id: pr.post_id, revision: pr.number
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it "ensures trust level 4 can see the revisions" do
|
||||
log_in(:elder)
|
||||
xhr :get, :revisions, post_id: post_revision.post_id, revision: post_revision.number
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "when edit history is visible to everyone" do
|
||||
|
Reference in New Issue
Block a user