summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
Diffstat (limited to 'test/system')
-rw-r--r--test/system/.keep0
-rw-r--r--test/system/crops_test.rb75
-rw-r--r--test/system/fertilizer_products_test.rb43
3 files changed, 118 insertions, 0 deletions
diff --git a/test/system/.keep b/test/system/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/system/.keep
diff --git a/test/system/crops_test.rb b/test/system/crops_test.rb
new file mode 100644
index 0000000..bbf3e28
--- /dev/null
+++ b/test/system/crops_test.rb
@@ -0,0 +1,75 @@
+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
diff --git a/test/system/fertilizer_products_test.rb b/test/system/fertilizer_products_test.rb
new file mode 100644
index 0000000..be82ed5
--- /dev/null
+++ b/test/system/fertilizer_products_test.rb
@@ -0,0 +1,43 @@
+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
Copyright 2019--2025 Marius PETER