diff --git a/spec/features/devices_spec.rb b/spec/features/devices_spec.rb index 573eaee8..a4799545 100644 --- a/spec/features/devices_spec.rb +++ b/spec/features/devices_spec.rb @@ -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" }