mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 12:24:04 +00:00
verify and slightly refactor regression test
This commit is contained in:
parent
4ce1ea9d4e
commit
b273d126e6
1 changed files with 5 additions and 9 deletions
|
|
@ -78,7 +78,8 @@ beforeEach(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('rls command succeeds when a view is in the database', function (string $manager) {
|
// Regression test for https://github.com/archtechx/tenancy/pull/1280
|
||||||
|
test('rls command doesnt fail when a view is in the database', function (string $manager) {
|
||||||
DB::statement("
|
DB::statement("
|
||||||
CREATE VIEW post_comments AS
|
CREATE VIEW post_comments AS
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -94,17 +95,12 @@ test('rls command succeeds when a view is in the database', function (string $ma
|
||||||
|
|
||||||
config(['tenancy.rls.manager' => $manager]);
|
config(['tenancy.rls.manager' => $manager]);
|
||||||
|
|
||||||
try {
|
// throws an exception without the patch
|
||||||
pest()->artisan('tenants:rls');
|
pest()->artisan('tenants:rls');
|
||||||
|
|
||||||
pest()->assertTrue(true);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
pest()->assertTrue(false);
|
|
||||||
}
|
|
||||||
})->with([
|
})->with([
|
||||||
TableRLSManager::class,
|
TableRLSManager::class,
|
||||||
TraitRLSManager::class,
|
TraitRLSManager::class,
|
||||||
]);
|
])->throwsNoExceptions();
|
||||||
|
|
||||||
test('postgres user gets created using the rls command', function(string $manager) {
|
test('postgres user gets created using the rls command', function(string $manager) {
|
||||||
config(['tenancy.rls.manager' => $manager]);
|
config(['tenancy.rls.manager' => $manager]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue