added internal rates (#1591)
This commit is contained in:
@@ -28,6 +28,10 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
public function testIsSecure()
|
||||
{
|
||||
$this->assertUrlIsSecured('/admin/activity/');
|
||||
}
|
||||
|
||||
public function testIsSecureForRole()
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/activity/');
|
||||
}
|
||||
|
||||
@@ -52,7 +56,6 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
});
|
||||
$this->importFixture($client, $fixture);
|
||||
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/');
|
||||
|
||||
$form = $client->getCrawler()->filter('form.header-search')->form();
|
||||
@@ -74,7 +77,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
/** @var EntityManager $em */
|
||||
$em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$fixture = new TimesheetFixtures();
|
||||
$fixture->setAmount(10);
|
||||
@@ -88,7 +91,6 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$fixture->setProjects([$project]);
|
||||
$this->importFixture($client, $fixture);
|
||||
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/1/details');
|
||||
self::assertHasProgressbar($client);
|
||||
|
||||
@@ -120,34 +122,6 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
self::assertStringContainsString('123.45', $node->text(null, true));
|
||||
}
|
||||
|
||||
public function testDeleteRateAction()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/1/rate');
|
||||
$form = $client->getCrawler()->filter('form[name=activity_rate_form]')->form();
|
||||
$client->submit($form, [
|
||||
'activity_rate_form' => [
|
||||
'user' => null,
|
||||
'rate' => 123.45,
|
||||
]
|
||||
]);
|
||||
$this->assertIsRedirect($client, $this->createUrl('/admin/activity/1/details'));
|
||||
$client->followRedirect();
|
||||
$node = $client->getCrawler()->filter('div.box#activity_rates_box');
|
||||
self::assertEquals(1, $node->count());
|
||||
$node = $client->getCrawler()->filter('div.box#activity_rates_box table.dataTable tbody tr:not(.summary)');
|
||||
self::assertEquals(1, $node->count());
|
||||
self::assertStringContainsString('123.45', $node->text(null, true));
|
||||
|
||||
$node = $client->getCrawler()->filter('div.box#activity_rates_box table.dataTable tbody tr td.actions a');
|
||||
self::assertEquals(1, $node->count());
|
||||
$url = $node->attr('href');
|
||||
$client->request('GET', $url);
|
||||
$this->assertIsRedirect($client, $this->createUrl('/admin/activity/1/details'));
|
||||
$node = $client->getCrawler()->filter('div.box#activity_rates_box table.dataTable tbody tr:not(.summary)');
|
||||
self::assertEquals(0, $node->count());
|
||||
}
|
||||
|
||||
public function testCreateAction()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
@@ -285,7 +259,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
/** @var EntityManager $em */
|
||||
$em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$fixture = new TimesheetFixtures();
|
||||
$fixture->setUser($this->getUserByRole($em, User::ROLE_USER));
|
||||
@@ -326,7 +300,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
/** @var EntityManager $em */
|
||||
$em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$fixture = new TimesheetFixtures();
|
||||
$fixture->setUser($this->getUserByRole($em, User::ROLE_USER));
|
||||
|
||||
Reference in New Issue
Block a user