X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/49fc17c6b6f60eba8737fcde85bd679d1b6de8c1..905a7eadb622761b3c752a113ca878faa316a37a:/test/system/diary_entry_test.rb diff --git a/test/system/diary_entry_test.rb b/test/system/diary_entry_test.rb index e890bba73..38e2a1847 100644 --- a/test/system/diary_entry_test.rb +++ b/test/system/diary_entry_test.rb @@ -43,4 +43,22 @@ class DiaryEntrySystemTest < ApplicationSystemTestCase assert_not page.has_content? @deleted_entry.title end + + test "deleted diary comments should be hidden for regular users" do + @deleted_comment = create(:diary_comment, :diary_entry => @diary_entry, :visible => false) + + sign_in_as(create(:user)) + visit diary_entry_path(@diary_entry.user, @diary_entry) + + assert_not page.has_content? @deleted_comment.body + end + + test "deleted diary comments should be shown to administrators" do + @deleted_comment = create(:diary_comment, :diary_entry => @diary_entry, :visible => false) + + sign_in_as(create(:administrator_user)) + visit diary_entry_path(@diary_entry.user, @diary_entry) + + assert page.has_content? @deleted_comment.body + end end