diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 18:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 18:09:05 +0300 |
commit | cf6a3e7ed4cb10a3e9fcbda810601387afc8b8d6 (patch) | |
tree | bda3707e95a53cb225793fded61d5073950b0b68 /spec/models | |
parent | 2a040e2655fe0a99df61ad0a7bd0c27e68af0c38 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_services/chat_message/push_message_spec.rb | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/spec/models/project_services/chat_message/push_message_spec.rb b/spec/models/project_services/chat_message/push_message_spec.rb index fe0b2fe3440..9d990508ab2 100644 --- a/spec/models/project_services/chat_message/push_message_spec.rb +++ b/spec/models/project_services/chat_message/push_message_spec.rb @@ -22,8 +22,14 @@ describe ChatMessage::PushMessage do context 'push' do before do args[:commits] = [ - { message: 'message1', url: 'http://url1.com', id: 'abcdefghijkl', author: { name: 'author1' } }, - { message: "message2\nsecondline", url: 'http://url2.com', id: '123456789012', author: { name: 'author2' } } + { message: 'message1', title: 'message1', url: 'http://url1.com', id: 'abcdefghijkl', author: { name: 'author1' } }, + { + message: 'message2' + ' w' * 100 + "\nsecondline", + title: 'message2 w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w ...', + url: 'http://url2.com', + id: '123456789012', + author: { name: 'author2' } + } ] end @@ -34,7 +40,7 @@ describe ChatMessage::PushMessage do '<http://url.com|project_name> (<http://url.com/compare/before...after|Compare changes>)') expect(subject.attachments).to eq([{ text: "<http://url1.com|abcdefgh>: message1 - author1\n\n"\ - "<http://url2.com|12345678>: message2\nsecondline - author2", + "<http://url2.com|12345678>: message2 w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w ... - author2", color: color }]) end @@ -49,27 +55,7 @@ describe ChatMessage::PushMessage do expect(subject.pretext).to eq( 'test.user pushed to branch [master](http://url.com/commits/master) of [project_name](http://url.com) ([Compare changes](http://url.com/compare/before...after))') expect(subject.attachments).to eq( - "[abcdefgh](http://url1.com): message1 - author1\n\n[12345678](http://url2.com): message2\nsecondline - author2") - expect(subject.activity).to eq( - title: 'test.user pushed to branch [master](http://url.com/commits/master)', - subtitle: 'in [project_name](http://url.com)', - text: '[Compare changes](http://url.com/compare/before...after)', - image: 'http://someavatar.com' - ) - end - end - - context 'with markdown and commit message html' do - before do - args[:commit_message_html] = true - args[:markdown] = true - end - - it 'returns a message regarding pushes' do - expect(subject.pretext).to eq( - 'test.user pushed to branch [master](http://url.com/commits/master) of [project_name](http://url.com) ([Compare changes](http://url.com/compare/before...after))') - expect(subject.attachments).to eq( - "[abcdefgh](http://url1.com): message1 - author1<br/>\n<br/>\n[12345678](http://url2.com): message2<br/>\nsecondline - author2") + "[abcdefgh](http://url1.com): message1 - author1\n\n[12345678](http://url2.com): message2 w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w ... - author2") expect(subject.activity).to eq( title: 'test.user pushed to branch [master](http://url.com/commits/master)', subtitle: 'in [project_name](http://url.com)', |