A free open source IT asset/license management system
Fix action_type from "created" to" create"
Marcus Mooreae24b73b3227
diff --git a/app/Models/ReportTemplate.php b/app/Models/ReportTemplate.phpindex f3537662f1..2be8ea3ed4 100644--- a/app/Models/ReportTemplate.php+++ b/app/Models/ReportTemplate.php@@ -52,7 +52,7 @@ class ReportTemplate extends Model'created_by' => auth()->id(),]);- $logAction->logaction('created');+ $logAction->logaction('create');});static::updated(function (ReportTemplate $reportTemplate) {diff --git a/tests/Unit/ActionLogTransformer/ReportTemplateActionLogTransformerTest.php b/tests/Unit/ActionLogTransformer/ReportTemplateActionLogTransformerTest.phpindex b6f67d741e..e4d594b497 100644--- a/tests/Unit/ActionLogTransformer/ReportTemplateActionLogTransformerTest.php+++ b/tests/Unit/ActionLogTransformer/ReportTemplateActionLogTransformerTest.php@@ -15,7 +15,10 @@ class ReportTemplateActionLogTransformerTest extends TestCase{ReportTemplate::factory()->create();- $actionLogs = Actionlog::whereMorphedTo('item', ReportTemplate::class)->get();+ $actionLogs = Actionlog::query()+ ->whereMorphedTo('item', ReportTemplate::class)+ ->where('action_type', 'create')+ ->get();// should be created when ActionLog is created$this->assertCount(1, $actionLogs);diff --git a/tests/Unit/Models/ReportTemplates/ReportTemplateActivityLoggingTest.php b/tests/Unit/Models/ReportTemplates/ReportTemplateActivityLoggingTest.phpindex d04ab7678b..e30a7e2c79 100644--- a/tests/Unit/Models/ReportTemplates/ReportTemplateActivityLoggingTest.php+++ b/tests/Unit/Models/ReportTemplates/ReportTemplateActivityLoggingTest.php@@ -20,7 +20,7 @@ class ReportTemplateActivityLoggingTest extends TestCase$this->assertDatabaseHas('action_logs', ['created_by' => $user->id,- 'action_type' => 'created',+ 'action_type' => 'create','target_id' => null,'target_type' => null,'item_type' => ReportTemplate::class,