]> source.dussan.org Git - redmine.git/commitdiff
simplify IssuesSystemTest#test_watch_issue_via_context_menu
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 4 Jul 2020 12:14:35 +0000 (12:14 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 4 Jul 2020 12:14:35 +0000 (12:14 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19857 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/system/issues_test.rb

index 048eb2f181b43d9a7bd2026bbfe57f3f90f7ce0c..0dda66e44d2978d823ee890940b83e49c8745996 100644 (file)
@@ -271,6 +271,9 @@ class IssuesSystemTest < ApplicationSystemTestCase
   def test_watch_issue_via_context_menu
     log_user('jsmith', 'jsmith')
     visit '/issues'
+    jsmith = User.find_by_login('jsmith')
+    issue1 = Issue.find(1)
+    assert_not issue1.reload.watched_by?(jsmith)
     assert page.has_css?('tr#issue-1')
     find('tr#issue-1 td.updated_on').click
     find('tr#issue-1 td.updated_on').right_click
@@ -283,7 +286,7 @@ class IssuesSystemTest < ApplicationSystemTestCase
       assert page.has_css?('#context-menu .issue-1-watcher.icon-fav')
       assert page.has_css?('tr#issue-1')
     end
-    assert Issue.find(1).watched_by?(User.find_by_login('jsmith'))
+    assert issue1.reload.watched_by?(jsmith)
   end
 
   def test_bulk_watch_issues_via_context_menu