mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Skip creating user when creating a setting since it isn't needed
This commit is contained in:
parent
16e3416225
commit
272cc1adac
|
@ -3,7 +3,6 @@
|
||||||
namespace Database\Factories;
|
namespace Database\Factories;
|
||||||
|
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
class SettingFactory extends Factory
|
class SettingFactory extends Factory
|
||||||
|
@ -23,7 +22,6 @@ class SettingFactory extends Factory
|
||||||
public function definition()
|
public function definition()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'user_id' => User::factory()->superuser(),
|
|
||||||
'per_page' => 20,
|
'per_page' => 20,
|
||||||
'site_name' => $this->faker->sentence(),
|
'site_name' => $this->faker->sentence(),
|
||||||
'auto_increment_assets' => false,
|
'auto_increment_assets' => false,
|
||||||
|
|
|
@ -17,8 +17,6 @@ class UsersForSelectListTest extends TestCase
|
||||||
|
|
||||||
$users = User::factory()->superuser()->count(3)->create();
|
$users = User::factory()->superuser()->count(3)->create();
|
||||||
|
|
||||||
$userCount = User::count();
|
|
||||||
|
|
||||||
Passport::actingAs($users->first());
|
Passport::actingAs($users->first());
|
||||||
$this->getJson(route('api.users.selectlist'))
|
$this->getJson(route('api.users.selectlist'))
|
||||||
->assertOk()
|
->assertOk()
|
||||||
|
@ -29,7 +27,7 @@ class UsersForSelectListTest extends TestCase
|
||||||
'page',
|
'page',
|
||||||
'page_count',
|
'page_count',
|
||||||
])
|
])
|
||||||
->assertJson(fn(AssertableJson $json) => $json->has('results', $userCount)->etc());
|
->assertJson(fn(AssertableJson $json) => $json->has('results', 3)->etc());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUsersScopedToCompanyWhenMultipleFullCompanySupportEnabled()
|
public function testUsersScopedToCompanyWhenMultipleFullCompanySupportEnabled()
|
||||||
|
|
Loading…
Reference in a new issue