aboutsummaryrefslogtreecommitdiffstats
path: root/test/controllers
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-11-14 15:47:43 +0000
committerMatthew Lemon <y@yulqen.org>2024-11-14 15:47:43 +0000
commit6427b28c60c6ed0dfd637307d1ab4ffe65c1144d (patch)
tree156d280b94557f9606c053f6187aec2a21eb1b36 /test/controllers
parent1b64b0b709c5704de48120e20bdfad32f34b0b5d (diff)
Adds ResourceType model
Diffstat (limited to 'test/controllers')
-rw-r--r--test/controllers/resource_types_controller_test.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/controllers/resource_types_controller_test.rb b/test/controllers/resource_types_controller_test.rb
new file mode 100644
index 0000000..c5621ab
--- /dev/null
+++ b/test/controllers/resource_types_controller_test.rb
@@ -0,0 +1,48 @@
+require "test_helper"
+
+class ResourceTypesControllerTest < ActionDispatch::IntegrationTest
+ setup do
+ @resource_type = resource_types(:one)
+ end
+
+ test "should get index" do
+ get resource_types_url
+ assert_response :success
+ end
+
+ test "should get new" do
+ get new_resource_type_url
+ assert_response :success
+ end
+
+ test "should create resource_type" do
+ assert_difference("ResourceType.count") do
+ post resource_types_url, params: { resource_type: { name: @resource_type.name } }
+ end
+
+ assert_redirected_to resource_type_url(ResourceType.last)
+ end
+
+ test "should show resource_type" do
+ get resource_type_url(@resource_type)
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get edit_resource_type_url(@resource_type)
+ assert_response :success
+ end
+
+ test "should update resource_type" do
+ patch resource_type_url(@resource_type), params: { resource_type: { name: @resource_type.name } }
+ assert_redirected_to resource_type_url(@resource_type)
+ end
+
+ test "should destroy resource_type" do
+ assert_difference("ResourceType.count", -1) do
+ delete resource_type_url(@resource_type)
+ end
+
+ assert_redirected_to resource_types_url
+ end
+end