diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-25 00:26:52 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-25 00:26:52 +0300 |
commit | c6d25083626c9a97a0ae442298b59c2ff9351f3a (patch) | |
tree | 0c6ac8026e8af2a4572400c9fc0a5dfaf7c7da29 /spec | |
parent | 5a3b9c97e34ee69312ef9bcf575894a106c5a271 (diff) |
Truncate page_description to 30 words
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/page_layout_helper_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/helpers/page_layout_helper_spec.rb b/spec/helpers/page_layout_helper_spec.rb index 5d95beac908..530e9bab343 100644 --- a/spec/helpers/page_layout_helper_spec.rb +++ b/spec/helpers/page_layout_helper_spec.rb @@ -22,6 +22,19 @@ describe PageLayoutHelper do expect(helper.page_description).to eq 'Foo Bar Baz' end + it 'truncates' do + helper.page_description <<-LOREM.strip_heredoc + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo + ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis + dis parturient montes, nascetur ridiculus mus. Donec quam felis, + ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa + quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, + arcu. + LOREM + + expect(helper.page_description).to end_with 'quam felis,...' + end + it 'sanitizes all HTML' do helper.page_description("<b>Bold</b> <h1>Header</h1>") |