diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-08-24 20:29:54 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-08-24 20:29:54 +0200 |
commit | 52b044d6a4278c229992404ad5801769c2d13363 (patch) | |
tree | b30b34da58f26117c035391d09366b190350b1e3 /test/controllers |
First commit.
Vive le Castel Peter !
Diffstat (limited to 'test/controllers')
-rw-r--r-- | test/controllers/crops_controller_test.rb | 48 | ||||
-rw-r--r-- | test/controllers/dashboard_controller_test.rb | 8 | ||||
-rw-r--r-- | test/controllers/fertilizer_products_controller_test.rb | 48 | ||||
-rw-r--r-- | test/controllers/nutrient_measurement_controller_test.rb | 8 | ||||
-rw-r--r-- | test/controllers/rafts_controller_test.rb | 7 | ||||
-rw-r--r-- | test/controllers/recipes_controller_test.rb | 7 |
6 files changed, 126 insertions, 0 deletions
diff --git a/test/controllers/crops_controller_test.rb b/test/controllers/crops_controller_test.rb new file mode 100644 index 0000000..71821b1 --- /dev/null +++ b/test/controllers/crops_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class CropsControllerTest < ActionDispatch::IntegrationTest + setup do + @crop = crops(:one) + end + + test "should get index" do + get crops_url + assert_response :success + end + + test "should get new" do + get new_crop_url + assert_response :success + end + + test "should create crop" do + assert_difference("Crop.count") do + post crops_url, params: { crop: { b: @crop.b, ca: @crop.ca, cl: @crop.cl, crop_type: @crop.crop_type, cu: @crop.cu, fe: @crop.fe, k: @crop.k, mg: @crop.mg, mn: @crop.mn, mo: @crop.mo, na: @crop.na, name: @crop.name, nnh4: @crop.nnh4, nno3: @crop.nno3, p: @crop.p, s: @crop.s, si: @crop.si, zn: @crop.zn } } + end + + assert_redirected_to crop_url(Crop.last) + end + + test "should show crop" do + get crop_url(@crop) + assert_response :success + end + + test "should get edit" do + get edit_crop_url(@crop) + assert_response :success + end + + test "should update crop" do + patch crop_url(@crop), params: { crop: { b: @crop.b, ca: @crop.ca, cl: @crop.cl, crop_type: @crop.crop_type, cu: @crop.cu, fe: @crop.fe, k: @crop.k, mg: @crop.mg, mn: @crop.mn, mo: @crop.mo, na: @crop.na, name: @crop.name, nnh4: @crop.nnh4, nno3: @crop.nno3, p: @crop.p, s: @crop.s, si: @crop.si, zn: @crop.zn } } + assert_redirected_to crop_url(@crop) + end + + test "should destroy crop" do + assert_difference("Crop.count", -1) do + delete crop_url(@crop) + end + + assert_redirected_to crops_url + end +end diff --git a/test/controllers/dashboard_controller_test.rb b/test/controllers/dashboard_controller_test.rb new file mode 100644 index 0000000..447c045 --- /dev/null +++ b/test/controllers/dashboard_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class DashboardControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get dashboard_index_url + assert_response :success + end +end diff --git a/test/controllers/fertilizer_products_controller_test.rb b/test/controllers/fertilizer_products_controller_test.rb new file mode 100644 index 0000000..dbdd44f --- /dev/null +++ b/test/controllers/fertilizer_products_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class FertilizerProductsControllerTest < ActionDispatch::IntegrationTest + setup do + @fertilizer_product = fertilizer_products(:one) + end + + test "should get index" do + get fertilizer_products_url + assert_response :success + end + + test "should get new" do + get new_fertilizer_product_url + assert_response :success + end + + test "should create fertilizer_product" do + assert_difference("FertilizerProduct.count") do + post fertilizer_products_url, params: { fertilizer_product: { name: @fertilizer_product.name, purity: @fertilizer_product.purity } } + end + + assert_redirected_to fertilizer_product_url(FertilizerProduct.last) + end + + test "should show fertilizer_product" do + get fertilizer_product_url(@fertilizer_product) + assert_response :success + end + + test "should get edit" do + get edit_fertilizer_product_url(@fertilizer_product) + assert_response :success + end + + test "should update fertilizer_product" do + patch fertilizer_product_url(@fertilizer_product), params: { fertilizer_product: { name: @fertilizer_product.name, purity: @fertilizer_product.purity } } + assert_redirected_to fertilizer_product_url(@fertilizer_product) + end + + test "should destroy fertilizer_product" do + assert_difference("FertilizerProduct.count", -1) do + delete fertilizer_product_url(@fertilizer_product) + end + + assert_redirected_to fertilizer_products_url + end +end diff --git a/test/controllers/nutrient_measurement_controller_test.rb b/test/controllers/nutrient_measurement_controller_test.rb new file mode 100644 index 0000000..02523e0 --- /dev/null +++ b/test/controllers/nutrient_measurement_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class NutrientMeasurementControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get nutrient_measurement_index_url + assert_response :success + end +end diff --git a/test/controllers/rafts_controller_test.rb b/test/controllers/rafts_controller_test.rb new file mode 100644 index 0000000..0d608d3 --- /dev/null +++ b/test/controllers/rafts_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class RaftsControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/recipes_controller_test.rb b/test/controllers/recipes_controller_test.rb new file mode 100644 index 0000000..2280833 --- /dev/null +++ b/test/controllers/recipes_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class RecipesControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end |