1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Use only one method to randomize

Instead of one per type, one for all is ok.
This commit is contained in:
Jeremy Benoist 2018-10-12 21:41:05 +02:00
parent f85d220c19
commit 0447a75b06
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
4 changed files with 42 additions and 85 deletions

View file

@ -1495,4 +1495,30 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
}
public function testRandom()
{
$this->logInAs('admin');
$client = $this->getClient();
$client->request('GET', '/unread/random');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'Unread random');
$client->request('GET', '/starred/random');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'Starred random');
$client->request('GET', '/archive/random');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'Archive random');
$client->request('GET', '/untagged/random');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'Untagged random');
$client->request('GET', '/all/random');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'All random');
}
}