Allow reporting of anonymous notes
[rails.git] / test / system / issues_test.rb
index efe5236346e9f85a29bba19a7a4b39a6c9ca3919..f11b05a2d50fad0a2ccd07d6a17482419a40124a 100644 (file)
@@ -1,6 +1,8 @@
 require "application_system_test_case"
 
 class IssuesTest < ApplicationSystemTestCase
+  include IssuesHelper
+
   def test_view_issues_normal_user
     sign_in_as(create(:user))
 
@@ -23,6 +25,18 @@ class IssuesTest < ApplicationSystemTestCase
     assert page.has_content?(issues.first.reported_user.display_name)
   end
 
+  def test_view_issues_with_no_reported_user
+    sign_in_as(create(:moderator_user))
+    anonymous_note = create(:note_with_comments)
+    issue = create(:issue, :reportable => anonymous_note)
+
+    visit issues_path
+    assert page.has_content?(reportable_title(anonymous_note))
+
+    visit issue_path(issue)
+    assert page.has_content?(reportable_title(anonymous_note))
+  end
+
   def test_search_issues_by_user
     good_user = create(:user)
     bad_user = create(:user)