View raw

1 require "application_system_test_case" 2 3 class BedsTest < ApplicationSystemTestCase 4 setup do 5 @bed = beds(:one) 6 end 7 8 test "visiting the index" do 9 visit beds_url 10 assert_selector "h1", text: "Beds" 11 end 12 13 test "should create bed" do 14 visit beds_url 15 click_on "New bed" 16 17 click_on "Create Bed" 18 19 assert_text "Bed was successfully created" 20 click_on "Back" 21 end 22 23 test "should update Bed" do 24 visit bed_url(@bed) 25 click_on "Edit this bed", match: :first 26 27 click_on "Update Bed" 28 29 assert_text "Bed was successfully updated" 30 click_on "Back" 31 end 32 33 test "should destroy Bed" do 34 visit bed_url(@bed) 35 click_on "Destroy this bed", match: :first 36 37 assert_text "Bed was successfully destroyed" 38 end 39 end 40