Merge pull request #15021 from snipe/fixes/removed_non_counts
Removed non-counts from allowed array
This commit is contained in:
commit
f22c3cdda9
3 changed files with 20 additions and 4 deletions
|
@ -247,10 +247,6 @@ class UsersController extends Controller
|
|||
'jobtitle',
|
||||
'username',
|
||||
'employee_num',
|
||||
'assets',
|
||||
'accessories',
|
||||
'consumables',
|
||||
'licenses',
|
||||
'groups',
|
||||
'activated',
|
||||
'created_at',
|
||||
|
|
|
@ -144,4 +144,17 @@ class UserSearchTest extends TestCase
|
|||
'User index contains unexpected user from another company'
|
||||
);
|
||||
}
|
||||
|
||||
public function testUsersIndexWhenInvalidSortFieldIsPassed()
|
||||
{
|
||||
$this->markIncompleteIfSqlite('This test is not compatible with SQLite');
|
||||
|
||||
$this->actingAsForApi(User::factory()->viewUsers()->create())
|
||||
->getJson(route('api.users.index', [
|
||||
'sort' => 'assets',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertStatus(200)
|
||||
->json();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,4 +10,11 @@ trait CanSkipTests
|
|||
$this->markTestIncomplete($message);
|
||||
}
|
||||
}
|
||||
|
||||
public function markIncompleteIfSqlite($message = 'Test skipped due to database driver being sqlite.')
|
||||
{
|
||||
if (config('database.default') === 'sqlite') {
|
||||
$this->markTestIncomplete($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue