Skip to content

Commit

Permalink
Correcting tests for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
aheber committed Nov 26, 2024
1 parent 9961585 commit bc535db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion dlrs/main/classes/RollupCalculateJobTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ private class RollupCalculateJobTest {
String jobId;
System.runAs(new User(Id = UserInfo.getUserId())) {
Test.startTest();
Assert.isTrue(FeatureManagement.checkPermission(permName));
Assert.areEqual(
true,
Utilities.userHasCustomPermission(permName),
'Expected user to have ' + permName
);
// go into runAs because we need to get the perms recalculated
jobId = Database.executeBatch(job);
Test.stopTest();
Expand Down
7 changes: 4 additions & 3 deletions dlrs/main/classes/RollupJobTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ private class RollupJobTest {
String jobId;
System.runAs(new User(Id = UserInfo.getUserId())) {
Test.startTest();
Assert.isTrue(
FeatureManagement.checkPermission(permName),
'Expected user to have the ' + permName + ' permission set'
Assert.areEqual(
true,
Utilities.userHasCustomPermission(permName),
'Expected user to have ' + permName
);
// go into runAs because we need to get the perms recalculated
jobId = Database.executeBatch(new RollupJob());
Expand Down

0 comments on commit bc535db

Please sign in to comment.