Flesh out the rest of the controller tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user