diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-06-13 08:23:32 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-13 08:23:32 +0000 |
commit | 504f3620330fa0cc8b6f3cb3f1647db2158a036f (patch) | |
tree | 870f125ae32037fe5b5f6b5da8f1ec4f7c6fb444 /spec | |
parent | 886b81e5c71529f1d61c4de4c16aab6171e1600e (diff) | |
parent | 9aad5ed0a23a6386bf48f166a6b07b3a41d9c2c1 (diff) | |
download | gitlab-ce-504f3620330fa0cc8b6f3cb3f1647db2158a036f.tar.gz |
Merge branch '42342-teams-pipeline-notifications' into 'master'
Resolve "Microsoft Teams notification for pipelines do not work"
Closes #42342
See merge request gitlab-org/gitlab-ce!19632
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/microsoft_teams/notifier_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_services/microsoft_teams_service_spec.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/spec/lib/microsoft_teams/notifier_spec.rb b/spec/lib/microsoft_teams/notifier_spec.rb index 3035693812f..c9756544bd6 100644 --- a/spec/lib/microsoft_teams/notifier_spec.rb +++ b/spec/lib/microsoft_teams/notifier_spec.rb @@ -8,7 +8,7 @@ describe MicrosoftTeams::Notifier do let(:options) do { title: 'JohnDoe4/project2', - pretext: '[[JohnDoe4/project2](http://localhost/namespace2/gitlabhq)] Issue [#1 Awesome issue](http://localhost/namespace2/gitlabhq/issues/1) opened by user6', + summary: '[[JohnDoe4/project2](http://localhost/namespace2/gitlabhq)] Issue [#1 Awesome issue](http://localhost/namespace2/gitlabhq/issues/1) opened by user6', activity: { title: 'Issue opened by user6', subtitle: 'in [JohnDoe4/project2](http://localhost/namespace2/gitlabhq)', diff --git a/spec/models/project_services/microsoft_teams_service_spec.rb b/spec/models/project_services/microsoft_teams_service_spec.rb index 8d9ee96227f..3351c6280b4 100644 --- a/spec/models/project_services/microsoft_teams_service_spec.rb +++ b/spec/models/project_services/microsoft_teams_service_spec.rb @@ -225,10 +225,15 @@ describe MicrosoftTeamsService do it 'calls Microsoft Teams API for pipeline events' do data = Gitlab::DataBuilder::Pipeline.build(pipeline) + data[:markdown] = true chat_service.execute(data) - expect(WebMock).to have_requested(:post, webhook_url).once + message = ChatMessage::PipelineMessage.new(data) + + expect(WebMock).to have_requested(:post, webhook_url) + .with(body: hash_including({ summary: message.summary })) + .once end end |