]> git.openstreetmap.org Git - rails.git/blobdiff - test/system/report_user_test.rb
Improve system tests for issues
[rails.git] / test / system / report_user_test.rb
index 0331e3ad73a936d50c9dbf5690b0a4b81a20abea..758c91eda16e6e2668fb5b050b5eb7f4c50bc93b 100644 (file)
@@ -6,7 +6,7 @@ class ReportUserTest < ApplicationSystemTestCase
     visit browse_note_path(note)
     assert page.has_content?(note.comments.first.body)
 
-    assert !page.has_content?(I18n.t("user.view.report"))
+    assert_not page.has_content?(I18n.t("user.view.report"))
   end
 
   def test_can_report_user
@@ -20,11 +20,12 @@ class ReportUserTest < ApplicationSystemTestCase
 
     choose I18n.t("reports.new.categories.user.vandal")
     fill_in "report_details", :with => "This user is a vandal"
-    click_on "Create Report"
+    assert_difference "Issue.count", 1 do
+      click_on "Create Report"
+    end
 
     assert page.has_content? "Your report has been registered sucessfully"
 
-    assert_equal 1, Issue.count
-    assert Issue.last.reportable == user
+    assert_equal user, Issue.last.reportable
   end
 end