mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-08-13 14:29:27 -07:00
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:
@@ -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" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user