summaryrefslogtreecommitdiff
path: root/test/system/crops_test.rb
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2025-08-24 20:29:54 +0200
committerMarius Peter <marius.peter@tutanota.com>2025-08-24 20:29:54 +0200
commit52b044d6a4278c229992404ad5801769c2d13363 (patch)
treeb30b34da58f26117c035391d09366b190350b1e3 /test/system/crops_test.rb
First commit.
Vive le Castel Peter !
Diffstat (limited to 'test/system/crops_test.rb')
-rw-r--r--test/system/crops_test.rb75
1 files changed, 75 insertions, 0 deletions
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
Copyright 2019--2025 Marius PETER