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
```
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user