Skip to content

Commit

Permalink
MDL-46755 format_social: Minor corrections during integration
Browse files Browse the repository at this point in the history
* Add additional checks in behat tests to ensure ordering of information
  does not give false positives
* Typo in lang pack
* Comment correction
  • Loading branch information
andrewnicols committed Jan 27, 2015
1 parent d927bc0 commit 85099b3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion course/format/social/format.php
Expand Up @@ -33,7 +33,8 @@

$numdiscussions = course_get_format($course)->get_course()->numdiscussions;
if ($numdiscussions < 1) {
$numdiscussions = 1; // Make sure that the value is at least zero.
// Make sure that the value is at least one.
$numdiscussions = 1;
}
forum_print_latest_discussions($course, $forum, $numdiscussions, 'plain', '', false);

Expand Down
2 changes: 1 addition & 1 deletion course/format/social/lang/en/format_social.php
Expand Up @@ -24,6 +24,6 @@
*/

$string['numberdiscussions'] = 'Number of discussions';
$string['numberdiscussions_help'] = 'This setting specifies how many discussions should be dispalyed.';
$string['numberdiscussions_help'] = 'This setting specifies how many discussions should be displayed.';
$string['pluginname'] = 'Social format';
$string['sectionname'] = 'section';
Expand Up @@ -92,7 +92,8 @@ Scenario: When number of discussions is decreased fewer discussions appear
And I set the following fields to these values:
| numdiscussions | 5 |
When I press "Save and display"
Then I should see "This is forum post five"
Then I should see "This is forum post one"
And I should see "This is forum post five"
And I should not see "This is forum post six"

Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear
Expand All @@ -102,12 +103,14 @@ Scenario: When number of discussions is decreased to less than 1 only 1 discussi
When I press "Save and display"
Then I should see "This is forum post one"
And I should not see "This is forum post two"
And I should not see "This is forum post ten"

Scenario: When number of discussions is increased more discussions appear
Given I click on "Edit settings" "link" in the "Administration" "block"
And I set the following fields to these values:
| numdiscussions | 9 |
When I press "Save and display"
Then I should see "This is forum post five"
Then I should see "This is forum post one"
And I should see "This is forum post five"
And I should see "This is forum post nine"
And I should not see "This is forum post ten"
And I should not see "This is forum post ten"

0 comments on commit 85099b3

Please sign in to comment.