require "application_system_test_case" class FertilizerProductsTest < ApplicationSystemTestCase setup do @fertilizer_product = fertilizer_products(:one) end test "visiting the index" do visit fertilizer_products_url assert_selector "h1", text: "Fertilizer products" end test "should create fertilizer product" do visit fertilizer_products_url click_on "New fertilizer product" fill_in "Name", with: @fertilizer_product.name fill_in "Purity", with: @fertilizer_product.purity click_on "Create Fertilizer product" assert_text "Fertilizer product was successfully created" click_on "Back" end test "should update Fertilizer product" do visit fertilizer_product_url(@fertilizer_product) click_on "Edit this fertilizer product", match: :first fill_in "Name", with: @fertilizer_product.name fill_in "Purity", with: @fertilizer_product.purity click_on "Update Fertilizer product" assert_text "Fertilizer product was successfully updated" click_on "Back" end test "should destroy Fertilizer product" do visit fertilizer_product_url(@fertilizer_product) click_on "Destroy this fertilizer product", match: :first assert_text "Fertilizer product was successfully destroyed" end end