Skip to content

Commit

Permalink
Merge branch 'MDL-65006-master' of git://github.com/sarjona/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Mar 18, 2019
2 parents e0757dd + 63be19c commit 6eca6f3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions admin/tool/policy/classes/output/page_agreedocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ protected function redirect_to_policies($userid, $returnurl = null) {
redirect(new moodle_url('/admin/tool/policy/view.php', $urlparams));
}
} else {
// Update the policyagreed for the user to avoid infinite loop because there are no policies to-be-accepted.
api::update_policyagreed($userid);
$this->redirect_to_previous_url();
}
}
Expand Down
20 changes: 20 additions & 0 deletions admin/tool/policy/tests/behat/acceptances.feature
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,23 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
When I press "Give consent"
Then "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
And "Accepted on user's behalf" "text" should exist in the "User Two" "table_row"

Scenario: View acceptances made by users on their own after inactivating a policy
Given I log in as "user1"
And I should see "This site policy"
And I should not see "Course overview"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I press "Next"
And I should see "Course overview"
And I log out
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I click on "Set status to \"Inactive\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I log out
When I log in as "user1"
Then I should see "Course overview"

0 comments on commit 6eca6f3

Please sign in to comment.