Merge pull request #7265 from pixelfed/fix-smoke-tests-and-cached-pages

Fix cached-page 500s and flaky smoke/API tests
pull/7266/head
Shlee 1 week ago committed by GitHub
commit ab423ae8a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -8,9 +8,9 @@
<hr>
@if($page)
<div>
{!!$page->content!!}
{!!$page['content']!!}
<hr>
<p class="">This document was last updated {{$page->created_at->format('M d, Y')}}.</p>
<p class="">This document was last updated {{$page['created_at']}}.</p>
</div>
@else
<div>

@ -4,8 +4,8 @@
<div class="container mt-5">
<div class="col-12">
<p class="font-weight-bold text-lighter text-uppercase">
@if($page && $page->title)
{!! $page->title !!}
@if($page && $page['title'])
{!! $page['title'] !!}
@else
Privacy Policy
@endif
@ -97,5 +97,5 @@
</div>
@endsection
@push('meta')
<meta property="og:description" content="@if($page && $page->title) {!! $page->title !!} @else Privacy Policy @endif">
<meta property="og:description" content="@if($page && $page['title']) {!! $page['title'] !!} @else Privacy Policy @endif">
@endpush

@ -4,8 +4,8 @@
<div class="container mt-5">
<div class="col-12">
<p class="font-weight-bold text-lighter text-uppercase">
@if($page && $page->title)
{!! $page->title !!}
@if($page && $page['title'])
{!! $page['title'] !!}
@else
Terms of Use
@endif
@ -57,5 +57,5 @@
@endsection
@push('meta')
<meta property="og:description" content="@if($page && $page->title) {!! $page->title !!} @else Terms of Use @endif">
<meta property="og:description" content="@if($page && $page['title']) {!! $page['title'] !!} @else Terms of Use @endif">
@endpush

@ -167,7 +167,11 @@ describe('scope enforcement on writes', function () {
describe('first-party session auth', function () {
it('allows writes without a token', function () {
config(['sanctum.stateful' => ['pixelfed.test']]);
// Derive the stateful domain from app.url so the Origin header and the
// sanctum.stateful entry always match, regardless of the environment's
// configured APP_URL (e.g. pixelfed.test in CI vs a local dev domain).
$host = parse_url(config('app.url'), PHP_URL_HOST);
config(['sanctum.stateful' => [$host]]);
$user = User::factory()->create();
$user->refresh();
$status = Status::factory()->create([

@ -44,6 +44,10 @@ describe('routes that require database', function () {
uses(LazilyRefreshDatabase::class);
test('register page loads', function () {
// The register form 404s when open registration is disabled (the
// default), so enable it for this smoke test.
config(['pixelfed.open_registration' => true]);
$this->get('/register')
->assertStatus(200);
});

Loading…
Cancel
Save