create(['portal' => $portal, 'is_active' => true]);
$category->translations()->create(['locale' => 'de', 'name' => $name, 'slug' => $slug]);
$category->translations()->create(['locale' => 'en', 'name' => $name.' EN', 'slug' => $slug.'-en']);
return $category;
}
test('the rss page explains feeds and lists the main feed, every industry feed and the newsroom pattern', function () {
/** @var TestCase $this */
rssCategory('handel', 'Handel');
rssCategory('energie', 'Energie');
$inactive = rssCategory('veraltet', 'Veraltet');
$inactive->update(['is_active' => false]);
rssCategory('fremd', 'Fremdportal', Portal::Businessportal24);
$this->get('https://presseecho.test/de/rss')
->assertSuccessful()
->assertSeeText('RSS-Feeds')
->assertSeeText('Was ist RSS?')
->assertSeeText('So funktioniert es')
->assertSeeText('Feeds auf presseecho')
->assertSee('href="https://presseecho.test/de/feed"', false)
->assertSeeText('https://presseecho.test/de/category/handel/feed')
->assertSeeText('https://presseecho.test/de/category/energie/feed')
->assertSeeText('/newsroom/unternehmen/feed')
->assertSee('href="https://businessportal24.test/de/rss"', false)
->assertSee('', false)
->assertDontSeeText('veraltet/feed')
->assertDontSeeText('fremd/feed');
});
test('the rss page renders in english on the en edition', function () {
/** @var TestCase $this */
rssCategory('handel', 'Handel', Portal::Both);
$this->get('https://businessportal24.test/en/rss')
->assertSuccessful()
->assertSeeText('What is RSS?')
->assertSeeText('https://businessportal24.test/en/category/handel-en/feed')
->assertSee('href="https://businessportal24.test/en/feed"', false);
});
test('the top bar, the mobile menu and the footer link to the rss page', function () {
/** @var TestCase $this */
$html = (string) $this->get('https://presseecho.test/de')->assertSuccessful()->getContent();
// Topleiste (Desktop), Burger-Menü und Footer — route() trägt in der Suite den konfigurierten Root-Host, deshalb nur der Pfad.
expect(substr_count($html, '/de/rss"'))->toBeGreaterThanOrEqual(3);
});
test('the hub sends the rss page to the leading portal and the sitemap lists it on the portals only', function () {
/** @var TestCase $this */
$this->get('https://pressekonto.test/de/rss')
->assertRedirect('https://presseecho.test/de/rss')
->assertStatus(301);
$this->get('https://presseecho.test/sitemap.xml')
->assertSee('https://presseecho.test/de/rss', false);
$this->get('https://pressekonto.test/sitemap.xml')
->assertDontSee('/de/rss', false);
});