We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22ab49e commit e1724d2Copy full SHA for e1724d2
tests/RedirectTest.php
@@ -42,6 +42,19 @@ public function an_url_could_expire()
42
$this->assertEquals(410, $response->status());
43
}
44
45
+ /** @test */
46
+ public function an_url_with_expiration_date_in_future_is_redirected()
47
+ {
48
+ $url = ['url' => 'https://laravel.com', 'code' => 'abcde', 'expires_at' => Carbon::now()->add('PT10M')];
49
+
50
+ $this->createUrl($url);
51
52
+ $response = $this->get(route('shorturl.redirect', ['code' => $url['code']]));
53
54
+ $this->assertEquals($url['url'], $response->headers->get('Location'));
55
+ $this->assertEquals(302, $response->status());
56
+ }
57
58
/** @test */
59
public function it_redirects_to_the_correct_url_after_update()
60
{
0 commit comments