summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-03-16 10:56:39 +0100
committerRémy Coutable <remy@rymai.me>2017-03-16 10:56:39 +0100
commit8b1a8676ee3ee327663bc2f6d41f118c67439c3f (patch)
treee74ffda235a7224da92f7d70449ab183cb7d95f6
parent50692556815dc7bc4ee8aa3175cf22226739a470 (diff)
downloadgitlab-ce-20121-reproduce-bug.tar.gz
Reproduce the bug when namespace name include HTML-escapable entities20121-reproduce-bug
This also provides a solution, we could probably create a new matcher that would HTML escape the expected text, e.g. have_html_escaped_body_text. Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--spec/mailers/notify_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index e822d7eb348..59566cb4bf5 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -488,7 +488,8 @@ describe Notify do
end
describe 'project access changed' do
- let(:project) { create(:empty_project, :public, :access_requestable) }
+ let(:owner) { create(:user, name: "Chang O'Keefe") }
+ let(:project) { create(:empty_project, :public, :access_requestable, namespace: owner.namespace) }
let(:user) { create(:user) }
let(:project_member) { create(:project_member, project: project, user: user) }
subject { Notify.member_access_granted_email('project', project_member.id) }
@@ -503,6 +504,10 @@ describe Notify do
is_expected.to have_body_text project.web_url
is_expected.to have_body_text project_member.human_access
end
+
+ it 'HTML-escaping project.name_with_namespace works...' do
+ is_expected.to have_body_text ERB::Util.html_escape(project.name_with_namespace)
+ end
end
def invite_to_project(project, inviter:)