From f3fcee430e319194bdf7b5e9ff893005d4907e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 23 Feb 2025 23:12:30 +0100 Subject: [PATCH] Use labels to find fields in dashboard actions tests In the tests for the edit/update action, we were using field names, but using labels is a better approach because it tests that the label is correctly associated with the field. We aren't changing the tests for the new/create action because we were already using labels there. --- spec/system/admin/dashboard/actions_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/system/admin/dashboard/actions_spec.rb b/spec/system/admin/dashboard/actions_spec.rb index 6d407ad15..645ceea0a 100644 --- a/spec/system/admin/dashboard/actions_spec.rb +++ b/spec/system/admin/dashboard/actions_spec.rb @@ -73,14 +73,14 @@ describe "Admin dashboard actions", :admin do end scenario "Updates the action" do - fill_in "dashboard_action_title", with: "Great action!" + fill_in "Title", with: "Great action!" click_button "Save" expect(page).to have_content "Great action!" end scenario "Renders edit form in case data is invalid" do - fill_in "dashboard_action_title", with: "x" + fill_in "Title", with: "x" click_button "Save" expect(page).to have_content("error prevented this Dashboard/Action from being saved.") end