diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/haml_lint | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/haml_lint')
-rw-r--r-- | spec/haml_lint/linter/no_plain_nodes_spec.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/haml_lint/linter/no_plain_nodes_spec.rb b/spec/haml_lint/linter/no_plain_nodes_spec.rb index 08deb5a4e9e..dc647467db6 100644 --- a/spec/haml_lint/linter/no_plain_nodes_spec.rb +++ b/spec/haml_lint/linter/no_plain_nodes_spec.rb @@ -53,4 +53,42 @@ describe HamlLint::Linter::NoPlainNodes do it { is_expected.to report_lint count: 3 } end + + context 'does not report when a html entity' do + let(:haml) { '%tag ' } + + it { is_expected.not_to report_lint } + end + + context 'does report when something that looks like a html entity' do + let(:haml) { '%tag &some text;' } + + it { is_expected.to report_lint } + end + + context 'does not report multiline when one or more html entities' do + %w( > © »).each do |elem| + let(:haml) { <<-HAML } + %tag + #{elem} + HAML + + it elem do + is_expected.not_to report_lint + end + end + end + + context 'does report multiline when one or more html entities amidst plain text' do + %w( Test Test> ©Hello Hello»).each do |elem| + let(:haml) { <<-HAML } + %tag + #{elem} + HAML + + it elem do + is_expected.to report_lint + end + end + end end |