Skip to content

Commit

Permalink
CRM-9408: Add tests for calls controller (#35652)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurio committed May 30, 2023
1 parent d616200 commit 456b1dd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions Controller/CallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public function indexAction()
/**
* @Route("/view/{id}", name="oro_call_view")
* @Template
* @AclAncestor("oro_call_view")
*/
public function viewAction(Call $entity)
{
Expand Down
38 changes: 38 additions & 0 deletions Tests/Behat/Features/call_view_by_direct_link.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@ticket-CRM-9408
@fixture-OroCallBundle:CallFixture.yml

Feature: Call view by direct link
In order to keep system ACL protected
As an Administrator
I should be sure that access to the calls by direct links are ACL protected

Scenario: Feature Background
Given sessions active:
| Admin |first_session |
| Admin1 |second_session |

Scenario: View call with default permissions
Given I proceed as the Admin
And I login as administrator
When I go to Activities/ Calls
Then I should see following grid:
| Subject |
| Test Call |
When I click view "Test Call" in grid
And I should see "Test Call"

Scenario: Edit view permissions for Call entity
Given I proceed as the Admin1
And I login as administrator
And I go to System / User Management / Roles
And I filter Label as is equal to "Administrator"
When I click edit "Administrator" in grid
And select following permissions:
| Call | View:None |
And save and close form
Then I should see "Role saved" flash message

Scenario: View call by direct link without view permission
Given I proceed as the Admin
When I reload the page
Then I should see "403. Forbidden You don't have permission to access this page."

0 comments on commit 456b1dd

Please sign in to comment.