mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
add spec for public edit history
This commit is contained in:
parent
ac8c2e1e07
commit
93ea940a4d
@ -395,6 +395,12 @@ describe Guardian do
|
||||
it 'is true when logged in' do
|
||||
Guardian.new(Fabricate(:user)).can_see?(post_revision).should == true
|
||||
end
|
||||
|
||||
it 'is true if the author has public edit history' do
|
||||
public_post_revision = Fabricate(:post_revision)
|
||||
public_post_revision.post.user.edit_history_public = true
|
||||
Guardian.new.can_see?(public_post_revision).should == true
|
||||
end
|
||||
end
|
||||
|
||||
context 'edit_history_visible_to_public is false' do
|
||||
@ -412,6 +418,12 @@ describe Guardian do
|
||||
it 'is false for trust level lower than 4' do
|
||||
Guardian.new(Fabricate(:leader)).can_see?(post_revision).should == false
|
||||
end
|
||||
|
||||
it 'is true if the author has public edit history' do
|
||||
public_post_revision = Fabricate(:post_revision)
|
||||
public_post_revision.post.user.edit_history_public = true
|
||||
Guardian.new.can_see?(public_post_revision).should == true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user