require "application_system_test_case" class CropsTest < ApplicationSystemTestCase setup do @crop = crops(:one) end test "visiting the index" do visit crops_url assert_selector "h1", text: "Crops" end test "should create crop" do visit crops_url click_on "New crop" fill_in "B", with: @crop.b fill_in "Ca", with: @crop.ca fill_in "Cl", with: @crop.cl fill_in "Crop type", with: @crop.crop_type fill_in "Cu", with: @crop.cu fill_in "Fe", with: @crop.fe fill_in "K", with: @crop.k fill_in "Mg", with: @crop.mg fill_in "Mn", with: @crop.mn fill_in "Mo", with: @crop.mo fill_in "Na", with: @crop.na fill_in "Name", with: @crop.name fill_in "Nnh4", with: @crop.nnh4 fill_in "Nno3", with: @crop.nno3 fill_in "P", with: @crop.p fill_in "S", with: @crop.s fill_in "Si", with: @crop.si fill_in "Zn", with: @crop.zn click_on "Create Crop" assert_text "Crop was successfully created" click_on "Back" end test "should update Crop" do visit crop_url(@crop) click_on "Edit this crop", match: :first fill_in "B", with: @crop.b fill_in "Ca", with: @crop.ca fill_in "Cl", with: @crop.cl fill_in "Crop type", with: @crop.crop_type fill_in "Cu", with: @crop.cu fill_in "Fe", with: @crop.fe fill_in "K", with: @crop.k fill_in "Mg", with: @crop.mg fill_in "Mn", with: @crop.mn fill_in "Mo", with: @crop.mo fill_in "Na", with: @crop.na fill_in "Name", with: @crop.name fill_in "Nnh4", with: @crop.nnh4 fill_in "Nno3", with: @crop.nno3 fill_in "P", with: @crop.p fill_in "S", with: @crop.s fill_in "Si", with: @crop.si fill_in "Zn", with: @crop.zn click_on "Update Crop" assert_text "Crop was successfully updated" click_on "Back" end test "should destroy Crop" do visit crop_url(@crop) click_on "Destroy this crop", match: :first assert_text "Crop was successfully destroyed" end end