diff options
Diffstat (limited to 'spec/helpers/events_helper_spec.rb')
-rw-r--r-- | spec/helpers/events_helper_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index 6b5e3d93d48..022aba0c0d0 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -6,34 +6,34 @@ describe EventsHelper do allow(helper).to receive(:current_user).and_return(double) end - it 'should display one line of plain text without alteration' do + it 'displays one line of plain text without alteration' do input = 'A short, plain note' expect(helper.event_note(input)).to match(input) expect(helper.event_note(input)).not_to match(/\.\.\.\z/) end - it 'should display inline code' do + it 'displays inline code' do input = 'A note with `inline code`' expected = 'A note with <code>inline code</code>' expect(helper.event_note(input)).to match(expected) end - it 'should truncate a note with multiple paragraphs' do + it 'truncates a note with multiple paragraphs' do input = "Paragraph 1\n\nParagraph 2" expected = 'Paragraph 1...' expect(helper.event_note(input)).to match(expected) end - it 'should display the first line of a code block' do + it 'displays the first line of a code block' do input = "```\nCode block\nwith two lines\n```" expected = %r{<pre.+><code>Code block\.\.\.</code></pre>} expect(helper.event_note(input)).to match(expected) end - it 'should truncate a single long line of text' do + it 'truncates a single long line of text' do text = 'The quick brown fox jumped over the lazy dog twice' # 50 chars input = text * 4 expected = (text * 2).sub(/.{3}/, '...') @@ -41,7 +41,7 @@ describe EventsHelper do expect(helper.event_note(input)).to match(expected) end - it 'should preserve a link href when link text is truncated' do + it 'preserves a link href when link text is truncated' do text = 'The quick brown fox jumped over the lazy dog' # 44 chars input = "#{text}#{text}#{text} " # 133 chars link_url = 'http://example.com/foo/bar/baz' # 30 chars @@ -52,7 +52,7 @@ describe EventsHelper do expect(helper.event_note(input)).to match(expected_link_text) end - it 'should preserve code color scheme' do + it 'preserves code color scheme' do input = "```ruby\ndef test\n 'hello world'\nend\n```" expected = '<pre class="code highlight js-syntax-highlight ruby">' \ "<code><span class=\"k\">def</span> <span class=\"nf\">test</span>\n" \ |