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
a1347b16
Commit
a1347b16
authored
Dec 01, 2021
by
Andy Soiron
Committed by
Kerri Miller
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix chat notification protected branch tests
parent
57ac6715
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
8 deletions
+22
-8
spec/factories/protected_branches.rb
spec/factories/protected_branches.rb
+15
-1
spec/models/integrations/microsoft_teams_spec.rb
spec/models/integrations/microsoft_teams_spec.rb
+1
-1
spec/support/shared_examples/models/chat_integration_shared_examples.rb
...hared_examples/models/chat_integration_shared_examples.rb
+2
-2
spec/support/shared_examples/models/concerns/integrations/slack_mattermost_notifier_shared_examples.rb
...integrations/slack_mattermost_notifier_shared_examples.rb
+4
-4
No files found.
spec/factories/protected_branches.rb
View file @
a1347b16
...
...
@@ -2,7 +2,7 @@
FactoryBot
.
define
do
factory
:protected_branch
do
name
sequence
(
:name
)
{
|
n
|
"protected_branch_
#{
n
}
"
}
project
transient
do
...
...
@@ -11,6 +11,20 @@ FactoryBot.define do
default_access_level
{
true
}
end
trait
:create_branch_on_repository
do
association
:project
,
factory:
[
:project
,
:repository
]
transient
do
repository_branch_name
{
name
}
end
after
(
:create
)
do
|
protected_branch
,
evaluator
|
project
=
protected_branch
.
project
project
.
repository
.
create_branch
(
evaluator
.
repository_branch_name
,
project
.
default_branch_or_main
)
end
end
trait
:developers_can_push
do
transient
do
default_push_level
{
false
}
...
...
spec/models/integrations/microsoft_teams_spec.rb
View file @
a1347b16
...
...
@@ -304,7 +304,7 @@ RSpec.describe Integrations::MicrosoftTeams do
context
'with protected branch'
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
'a-protected-branch'
)
create
(
:protected_branch
,
:create_branch_on_repository
,
project:
project
,
name:
'a-protected-branch'
)
end
let
(
:pipeline
)
do
...
...
spec/support/shared_examples/models/chat_integration_shared_examples.rb
View file @
a1347b16
...
...
@@ -113,7 +113,7 @@ RSpec.shared_examples "chat integration" do |integration_name|
context
"with protected branch"
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
"a-protected-branch"
)
create
(
:protected_branch
,
:create_branch_on_repository
,
project:
project
,
name:
"a-protected-branch"
)
end
let
(
:sample_data
)
do
...
...
@@ -309,7 +309,7 @@ RSpec.shared_examples "chat integration" do |integration_name|
context
"with protected branch"
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
"a-protected-branch"
)
create
(
:protected_branch
,
:create_branch_on_repository
,
project:
project
,
name:
"a-protected-branch"
)
end
let
(
:sample_data
)
do
...
...
spec/support/shared_examples/models/concerns/integrations/slack_mattermost_notifier_shared_examples.rb
View file @
a1347b16
...
...
@@ -305,7 +305,7 @@ RSpec.shared_examples Integrations::SlackMattermostNotifier do |service_name|
context
'on a protected branch'
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
'a-protected-branch'
)
create
(
:protected_branch
,
:create_branch_on_repository
,
project:
project
,
name:
'a-protected-branch'
)
end
let
(
:data
)
do
...
...
@@ -347,7 +347,7 @@ RSpec.shared_examples Integrations::SlackMattermostNotifier do |service_name|
context
'on a protected branch with protected branches defined using wildcards'
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
'*-stable'
)
create
(
:protected_branch
,
:create_branch_on_repository
,
repository_branch_name:
'1-stable'
,
project:
project
,
name:
'*-stable'
)
end
let
(
:data
)
do
...
...
@@ -560,7 +560,7 @@ RSpec.shared_examples Integrations::SlackMattermostNotifier do |service_name|
context
'on a protected branch'
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
'a-protected-branch'
)
create
(
:protected_branch
,
:create_branch_on_repository
,
project:
project
,
name:
'a-protected-branch'
)
end
let
(
:pipeline
)
do
...
...
@@ -590,7 +590,7 @@ RSpec.shared_examples Integrations::SlackMattermostNotifier do |service_name|
context
'on a protected branch with protected branches defined usin wildcards'
do
before
do
create
(
:protected_branch
,
project:
project
,
name:
'*-stable'
)
create
(
:protected_branch
,
:create_branch_on_repository
,
repository_branch_name:
'1-stable'
,
project:
project
,
name:
'*-stable'
)
end
let
(
:pipeline
)
do
...
...
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