View raw

1 require "application_system_test_case" 2 3 class FertilizerProductsTest < ApplicationSystemTestCase 4 setup do 5 @fertilizer_product = fertilizer_products(:one) 6 end 7 8 test "visiting the index" do 9 visit fertilizer_products_url 10 assert_selector "h1", text: "Fertilizer products" 11 end 12 13 test "should create fertilizer product" do 14 visit fertilizer_products_url 15 click_on "New fertilizer product" 16 17 fill_in "Name", with: @fertilizer_product.name 18 fill_in "Purity", with: @fertilizer_product.purity 19 click_on "Create Fertilizer product" 20 21 assert_text "Fertilizer product was successfully created" 22 click_on "Back" 23 end 24 25 test "should update Fertilizer product" do 26 visit fertilizer_product_url(@fertilizer_product) 27 click_on "Edit this fertilizer product", match: :first 28 29 fill_in "Name", with: @fertilizer_product.name 30 fill_in "Purity", with: @fertilizer_product.purity 31 click_on "Update Fertilizer product" 32 33 assert_text "Fertilizer product was successfully updated" 34 click_on "Back" 35 end 36 37 test "should destroy Fertilizer product" do 38 visit fertilizer_product_url(@fertilizer_product) 39 click_on "Destroy this fertilizer product", match: :first 40 41 assert_text "Fertilizer product was successfully destroyed" 42 end 43 end 44