From b341debdffad68ae66ef2b791b48d0ca81b80f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 19 Sep 2021 18:14:45 +0200 Subject: [PATCH] Update calls to within_fieldset with keyword args We were getting a warning with Ruby 2.7: ``` ruby/gems/2.7.0/gems/capybara-3.37.1/lib/capybara/session.rb:377: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call ``` On Ruby 3.0, the test failed with `Unable to find fieldset {:text=>"Draft phase"}` and we were also getting another warning: ``` Locator Hash:{:text=>"Draft phase"} for selector :fieldset must be an instance of String or Symbol. This will raise an error in a future version of Capybara ``` --- spec/system/admin/legislation/processes_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/system/admin/legislation/processes_spec.rb b/spec/system/admin/legislation/processes_spec.rb index ca001bbf1..f3b969e57 100644 --- a/spec/system/admin/legislation/processes_spec.rb +++ b/spec/system/admin/legislation/processes_spec.rb @@ -65,7 +65,7 @@ describe "Admin collaborative legislation", :admin do base_date = Date.current - within_fieldset text: "Draft phase" do + within "fieldset", text: "Draft phase" do check "Enabled" fill_in "Start", with: base_date - 3.days fill_in "End", with: base_date - 1.day @@ -134,7 +134,7 @@ describe "Admin collaborative legislation", :admin do base_date = Date.current - 2.days - within_fieldset text: "Draft phase" do + within "fieldset", text: "Draft phase" do check "Enabled" fill_in "Start", with: base_date fill_in "End", with: base_date + 3.days