Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 15:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 15:09:00 +0300
commit88a0824944720b6edaaef56376713541b9a02118 (patch)
treef5fcc4f9755f249779cda9a8f02902d734af6e7e /spec/lib/microsoft_teams/notifier_spec.rb
parent7d19df2d34a9803d9f077c16315ba919b7ae2aa2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/microsoft_teams/notifier_spec.rb')
-rw-r--r--spec/lib/microsoft_teams/notifier_spec.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/lib/microsoft_teams/notifier_spec.rb b/spec/lib/microsoft_teams/notifier_spec.rb
index 64ab8d85807..25538db159e 100644
--- a/spec/lib/microsoft_teams/notifier_spec.rb
+++ b/spec/lib/microsoft_teams/notifier_spec.rb
@@ -17,7 +17,7 @@ describe MicrosoftTeams::Notifier do
text: '[#1 Awesome issue](http://localhost/namespace2/gitlabhq/issues/1)',
image: 'http://someimage.com'
},
- attachments: 'please fix'
+ attachments: "[GitLab](https://gitlab.com)\n\n- _Ruby_\n- **Go**\n"
}
end
@@ -31,13 +31,7 @@ describe MicrosoftTeams::Notifier do
'activityImage' => 'http://someimage.com'
},
{
- 'title' => 'Details',
- 'facts' => [
- {
- 'name' => 'Attachments',
- 'value' => 'please fix'
- }
- ]
+ text: "[GitLab](https://gitlab.com)\n\n- _Ruby_\n- **Go**\n"
}
],
'title' => 'JohnDoe4/project2',
@@ -54,4 +48,14 @@ describe MicrosoftTeams::Notifier do
expect(subject.ping(options)).to be true
end
end
+
+ describe '#body' do
+ it 'returns Markdown-based body when HTML was passed' do
+ expect(subject.send(:body, options)).to eq(body.to_json)
+ end
+
+ it 'fails when empty Hash was passed' do
+ expect { subject.send(:body, {}) }.to raise_error(ArgumentError)
+ end
+ end
end