Skip to content

Commit a98836e

Browse files
committed
wip
1 parent 7c3abbf commit a98836e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

Diff for: app/Markdown/MarkdownServiceProvider.php

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public function register(): void
3030
'internal_hosts' => config('app.host'),
3131
'open_in_new_window' => true,
3232
'nofollow' => ($params['nofollow'] ?? true) ? 'external' : '',
33-
'noreferrer' => ($params['nofollow'] ?? true) ? 'external' : '',
34-
'noopener' => ($params['nofollow'] ?? true) ? 'external' : '',
3533
],
3634
]);
3735

Diff for: tests/Feature/ArticleTest.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,24 @@
144144
->assertSee($article->title());
145145
});
146146

147+
test('articles with links do not include a nofollow attributes', function () {
148+
$article = Article::factory()->approved()->create([
149+
'slug' => 'my-first-article',
150+
'submitted_at' => now(),
151+
'body' => 'This article will go into depth on working with database migrations. Here is [a link](https://example.com).',
152+
]);
153+
154+
$this->get('/articles/my-first-article')
155+
->assertSee($article->title())
156+
->assertDontSee('nofollow');
157+
});
158+
147159
test('logged in users can view an article', function () {
148-
$article = Article::factory()->create(['slug' => 'my-first-article', 'submitted_at' => now(), 'approved_at' => now()]);
160+
$article = Article::factory()->create([
161+
'slug' => 'my-first-article',
162+
'submitted_at' => now(),
163+
'approved_at' => now(),
164+
]);
149165

150166
$this->login();
151167

@@ -419,7 +435,7 @@
419435
->assertSee($articles[2]->title());
420436
});
421437

422-
test('a user can another users articles', function () {
438+
test("a user cannot view another user's articles", function () {
423439
$articles = Article::factory()->count(3)->create();
424440

425441
$this->login();

0 commit comments

Comments
 (0)