Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-03-16 12:56:39 +0300
committerRémy Coutable <remy@rymai.me>2017-03-17 14:20:54 +0300
commit517598ba10793efa02cb90379f78ab97c9c5b25d (patch)
tree92c5a186aa1dd8104a9bd2fe5412ffc0e0e8292b /spec/support/matchers
parentf016da6207502c090f24fc5e79b6b89d9aa9b4b0 (diff)
Add a new have_html_escaped_body_text that match an HTML-escaped text
This solves transient failures when a text contains HTML-escapable characters such as `'`. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support/matchers')
-rw-r--r--spec/support/matchers/email_matchers.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/support/matchers/email_matchers.rb b/spec/support/matchers/email_matchers.rb
new file mode 100644
index 00000000000..d9d59ec12ec
--- /dev/null
+++ b/spec/support/matchers/email_matchers.rb
@@ -0,0 +1,5 @@
+RSpec::Matchers.define :have_html_escaped_body_text do |expected|
+ match do |actual|
+ expect(actual).to have_body_text(ERB::Util.html_escape(expected))
+ end
+end