From b55a6a365e54c14f4f0fa3cda9c40b50155a48b8 Mon Sep 17 00:00:00 2001
From: Takashi Kato <tohosaku@users.osdn.me>
Date: Sat, 23 Sep 2023 07:38:59 +0000
Subject: [PATCH] Use capybara assertion

---
 test/system/issues_test.rb  | 9 +++++----
 test/system/timelog_test.rb | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb
index a66b19e38..f0a749238 100644
--- a/test/system/issues_test.rb
+++ b/test/system/issues_test.rb
@@ -443,8 +443,8 @@ class IssuesSystemTest < ApplicationSystemTestCase
     # wait for ajax response
     assert page.has_select?('issue_project_id', selected: 'OnlineStore')
 
+    assert_selector 'input[type=submit]', count: 2
     submit_buttons = page.all('input[type=submit]')
-    assert_equal 2, submit_buttons.size
     assert_equal 'Move', submit_buttons[0].value
     assert_equal 'Move and follow', submit_buttons[1].value
 
@@ -507,8 +507,9 @@ class IssuesSystemTest < ApplicationSystemTestCase
     # wait for ajax response
     assert page.has_select?('issue_project_id', selected: 'OnlineStore')
 
+    assert_selector 'input[type=submit]', count: 2
     submit_buttons = page.all('input[type=submit]')
-    assert_equal 2, submit_buttons.size
+
     assert_equal 'Copy', submit_buttons[0].value
     assert_equal 'Copy and follow', submit_buttons[1].value
     page.find('#issue_priority_id').select('High')
@@ -645,7 +646,7 @@ class IssuesSystemTest < ApplicationSystemTestCase
     wait_for_ajax
 
     # assert log time form does not exist anymore for user without required permissions on the new project
-    assert_not page.has_css?('#log_time')
+    assert page.has_no_css?('#log_time')
   end
 
   def test_update_issue_form_should_include_add_notes_form_only_for_users_with_permission
@@ -665,6 +666,6 @@ class IssuesSystemTest < ApplicationSystemTestCase
     wait_for_ajax
 
     # assert add notes form does not exist anymore for user without required permissions on the new project
-    assert_not page.has_css?('#add_notes')
+    assert page.has_no_css?('#add_notes')
   end
 end
diff --git a/test/system/timelog_test.rb b/test/system/timelog_test.rb
index b4ee1fd75..8bf9cdde4 100644
--- a/test/system/timelog_test.rb
+++ b/test/system/timelog_test.rb
@@ -43,7 +43,7 @@ class TimelogTest < ApplicationSystemTestCase
     end
     within 'select#time_entry_activity_id' do
       assert has_content?('Development')
-      assert !has_content?('Design')
+      assert has_no_content?('Design')
     end
   end
 
@@ -69,7 +69,7 @@ class TimelogTest < ApplicationSystemTestCase
     fill_in 'Hours', :with => '7'
     page.first(:button, 'Submit').click
 
-    assert_equal "/projects/ecookbook/time_entries", current_path
+    assert_current_path "/projects/ecookbook/time_entries"
     entries = TimeEntry.where(:id => [1,2,3]).to_a
     assert entries.all? {|entry| entry.hours == 7.0}
   end
-- 
2.39.2

