Fixed devices feature spec to perform all actions in single spec

Noticed this ended up being a flaky spec failure in CI (but not locally) so collapsed everything down to a single spec (which is more in line with the other feature specs). This speeds up the spec as well.

Milestone: patch
This commit is contained in:
Brooke Kuhlmann
2026-02-05 15:17:36 -07:00
parent fa5744d402
commit 49cae4c540
+2 -16
View File
@@ -10,7 +10,7 @@ RSpec.describe "Devices", :db do
before { model }
it "creates and views device", :aggregate_failures, :js do
it "creates, edits, and deletes device", :aggregate_failures, :js do
visit routes.path(:devices)
click_link "New"
click_button "Save"
@@ -23,32 +23,18 @@ RSpec.describe "Devices", :db do
click_link "View"
expect(page).to have_content("AA:BB:CC:11:22:33")
end
it "edits and errors when model is not selected", :js do
visit routes.path(:device_edit, id: device.id)
select "Select...", from: "device[model_id]"
click_button "Save"
expect(page).to have_content("must be filled")
end
it "edits and deletes device", :aggregate_failures, :js do
visit routes.path(:device_edit, id: device.id)
click_link "Edit"
fill_in "device[label]", with: ""
click_button "Save"
expect(page).to have_content("must be filled")
select model.label, from: "device[model_id]"
fill_in "device[label]", with: "Device Test"
click_button "Save"
expect(page).to have_content("Device Test")
end
it "deletes device", :js do
device
visit routes.path(:devices)
accept_prompt { click_button "Delete" }