Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
88a99594
Commit
88a99594
authored
Dec 17, 2021
by
Andy Soiron
Committed by
Mayra Cabrera
Dec 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for chat integration deployment events
parent
757dd41a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
spec/models/integrations/microsoft_teams_spec.rb
spec/models/integrations/microsoft_teams_spec.rb
+11
-0
spec/support/shared_examples/models/chat_integration_shared_examples.rb
...hared_examples/models/chat_integration_shared_examples.rb
+7
-1
No files found.
spec/models/integrations/microsoft_teams_spec.rb
View file @
88a99594
...
...
@@ -3,6 +3,17 @@
require
'spec_helper'
RSpec
.
describe
Integrations
::
MicrosoftTeams
do
it_behaves_like
"chat integration"
,
"Microsoft Teams"
do
let
(
:client
)
{
::
MicrosoftTeams
::
Notifier
}
let
(
:client_arguments
)
{
webhook_url
}
let
(
:payload
)
do
{
summary:
be_present
}
end
end
let
(
:chat_integration
)
{
described_class
.
new
}
let
(
:webhook_url
)
{
'https://example.gitlab.com/'
}
...
...
spec/support/shared_examples/models/chat_integration_shared_examples.rb
View file @
88a99594
...
...
@@ -71,7 +71,7 @@ RSpec.shared_examples "chat integration" do |integration_name|
it
"does not call
#{
integration_name
}
API"
do
result
=
subject
.
execute
(
sample_data
)
expect
(
result
).
to
be
(
false
)
expect
(
result
).
to
be
_falsy
expect
(
WebMock
).
not_to
have_requested
(
:post
,
webhook_url
)
end
end
...
...
@@ -355,5 +355,11 @@ RSpec.shared_examples "chat integration" do |integration_name|
end
end
end
context
'deployment events'
do
let
(
:sample_data
)
{
Gitlab
::
DataBuilder
::
Deployment
.
build
(
create
(
:deployment
),
Time
.
now
)
}
it_behaves_like
"untriggered
#{
integration_name
}
integration"
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment