MDL-43883 Atto behat: Rubrics are expecting magic tweaking in text from tinymce.

This commit is contained in:
Damyon Wiese
2014-03-26 10:01:49 +08:00
parent 9f07f05a48
commit 5f3ea8cf66
2 changed files with 3 additions and 2 deletions
@@ -45,7 +45,7 @@ Feature: Publish rubrics as templates
@javascript
Scenario: Create a rubric template and reuse it as a teacher, with Javascript enabled
Then the field "Description" matches value "<p>Assignment 1 description</p>"
Then the field "Description" matches value "Assignment 1 description"
And I should see "Criterion 1"
And I press "Cancel"
+2 -1
View File
@@ -63,7 +63,8 @@ class behat_form_text extends behat_form_field {
* @return bool The provided value matches the field value?
*/
public function matches($expectedvalue) {
return $this->text_matches($expectedvalue);
// A text editor may silently wrap the content in p tags (or not). Neither is an error.
return $this->text_matches($expectedvalue) || $this->text_matches('<p>' . $expectedvalue . '</p>');
}
}