test only on the hidePosts policy ability

This commit is contained in:
Daniel Klabbers 2019-11-21 11:47:01 +01:00 committed by Daniël Klabbers
parent 6fcc720f6c
commit 07313a15c4

View File

@ -117,7 +117,9 @@ class ShowDiscussionControllerTest extends ApiControllerTestCase
$events = app(Dispatcher::class);
$events->listen(ScopeModelVisibility::class, function (ScopeModelVisibility $event) {
$event->query->whereRaw('1=1');
if ($event->ability === 'discussion.hidePosts') {
$event->query->whereRaw('1=1');
}
});
$response = $this->callWith([], ['id' => 4]);