Use Parcel2Go public API scope by default
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m1s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m1s
This commit is contained in:
@@ -47,6 +47,7 @@ class DashboardAccessTest extends TestCase
|
||||
config()->set('services.parcel2go', [
|
||||
'client_id' => 'id', 'client_secret' => 'secret',
|
||||
'auth_url' => 'https://auth.example.test/token', 'base_url' => 'https://shipping.example.test/api',
|
||||
'scope' => 'public-api my-profile',
|
||||
]);
|
||||
config()->set('services.dryer', ['url' => 'https://dryer.example.test/api/v1', 'api_key' => 'key']);
|
||||
EtsyConnection::create(['shop_id' => 42, 'shop_name' => 'HickLab3D', 'access_token' => '123.token', 'refresh_token' => '123.refresh', 'expires_at' => now()->addHour()]);
|
||||
@@ -191,10 +192,13 @@ class DashboardAccessTest extends TestCase
|
||||
'client_id' => 'id', 'client_secret' => 'secret',
|
||||
'auth_url' => 'https://auth.example.test/token',
|
||||
'base_url' => 'https://shipping.example.test/api',
|
||||
'scope' => 'public-api my-profile',
|
||||
]);
|
||||
$admin = User::factory()->create(['role' => 'admin']);
|
||||
|
||||
$this->actingAs($admin)->get(route('shipping'))->assertOk()->assertSee('Lee Hickman')->assertSee('12.50');
|
||||
Http::assertSentCount(6);
|
||||
Http::assertSent(fn ($request) => $request->url() === 'https://auth.example.test/token'
|
||||
&& $request['scope'] === 'public-api my-profile');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user