diff --git a/test/controllers/workflows_controller_test.rb b/test/controllers/workflows_controller_test.rb index 392f6514b..8d3d64c69 100644 --- a/test/controllers/workflows_controller_test.rb +++ b/test/controllers/workflows_controller_test.rb @@ -11,9 +11,33 @@ class WorkflowsControllerTest < ActionDispatch::IntegrationTest end test "create" do + get new_workflow_path + assert_response :success + assert_difference -> { Workflow.count }, +1 do post workflows_path, params: { workflow: { name: "My new workflow!" } } assert_redirected_to workflows_path end end + + test "show" do + get workflow_path(workflows(:on_call)) + assert_in_body workflows(:on_call).name + end + + test "update" do + get edit_workflow_path(workflows(:on_call)) + assert_response :success + + put workflow_path(workflows(:on_call)), params: { workflow: { name: "Monkeyflow!" } } + follow_redirect! + assert_in_body "Monkeyflow!" + end + + test "destroy" do + assert_difference -> { Workflow.count }, -1 do + delete workflow_path(workflows(:on_call)) + assert_redirected_to workflows_path + end + end end