Fix tests

This commit is contained in:
Jorge Manrubia
2025-09-29 13:13:40 +02:00
parent 859a016a2e
commit 1bb8de8564
14 changed files with 552 additions and 165 deletions
@@ -1,12 +0,0 @@
module WorkflowScoped
extend ActiveSupport::Concern
included do
before_action :set_workflow
end
private
def set_workflow
@workflow = Workflow.find(params[:workflow_id])
end
end
@@ -1,36 +0,0 @@
class Workflows::StagesController < ApplicationController
include WorkflowScoped
before_action :set_stage, only: %i[ edit update destroy ]
def new
@stage = @workflow.stages.new
end
def create
@stage = @workflow.stages.create! stage_params
redirect_to @workflow
end
def edit
end
def update
@stage.update! stage_params
redirect_to @workflow
end
def destroy
@stage.destroy
redirect_to @workflow
end
private
def set_stage
@stage = @workflow.stages.find params[:id]
end
def stage_params
params.require(:workflow_stage).permit(:name, :color)
end
end