Fix tests, remove workflow controllers

This commit is contained in:
Jorge Manrubia
2025-09-28 18:50:26 +02:00
parent b0e62a3a4f
commit e14262dc01
9 changed files with 4 additions and 156 deletions
@@ -1,12 +0,0 @@
require "test_helper"
class Cards::StagingsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "update" do
put card_staging_path(cards(:logo)), params: { stage_id: workflow_stages(:qa_in_progress).id }, as: :turbo_stream
assert_card_container_rerendered(cards(:logo))
end
end
@@ -1,16 +0,0 @@
require "test_helper"
class Collections::WorkflowsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "update" do
collection = collections(:writebook)
patch collection_workflow_path(collection), params: { collection: { workflow_id: workflows(:on_call).id } }
assert_turbo_stream action: :replace, target: dom_id(collection, :workflows)
assert_equal workflows(:on_call), collection.reload.workflow
end
end
@@ -1,43 +0,0 @@
require "test_helper"
class WorkflowsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "index" do
get workflows_path
assert_in_body workflows(:on_call).name
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