edit ledger mogelijk gemaakt
linter / quality (push) Failing after 1m7s
tests / ci (8.3) (push) Failing after 50s
tests / ci (8.4) (push) Failing after 1m6s
tests / ci (8.5) (push) Failing after 1m12s

This commit is contained in:
Daan Meijer
2026-07-06 11:44:09 +02:00
parent 800cb7a819
commit 57be9168e5
2 changed files with 50 additions and 2 deletions
+22
View File
@@ -55,3 +55,25 @@ test('non-owners cannot view ledger creation form or store ledgers', function ()
'name' => 'Illegal Ledger',
]);
});
test('owner can edit a ledger', function () {
$owner = User::factory()->create();
$dynamic = Dynamic::factory()->create();
$dynamic->participants()->attach($owner->id, ['role' => 'owner']);
$ledger = Ledger::factory()->create(['dynamic_id' => $dynamic->id]);
$this->actingAs($owner);
$response = $this->put(route('dynamics.ledgers.update', [$dynamic->uuid, $ledger->uuid]), [
'name' => 'Updated Ledger Name',
'rules' => 'Updated rules.',
'alignment' => 'negative',
]);
$response->assertRedirect(route('dynamics.ledgers.show', [$dynamic->uuid, $ledger->uuid]));
$ledger->refresh();
expect($ledger->name)->toBe('Updated Ledger Name');
expect($ledger->rules)->toBe('Updated rules.');
expect($ledger->alignment)->toBe('negative');
});