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
4c5ee223
Commit
4c5ee223
authored
Jun 29, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to service in emails_on_push model spec
parent
7e245302
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
spec/models/integrations/emails_on_push_spec.rb
spec/models/integrations/emails_on_push_spec.rb
+7
-7
No files found.
spec/models/integrations/emails_on_push_spec.rb
View file @
4c5ee223
...
...
@@ -6,7 +6,7 @@ RSpec.describe Integrations::EmailsOnPush do
let_it_be
(
:project
)
{
create_default
(
:project
).
freeze
}
describe
'Validations'
do
context
'when
service
is active'
do
context
'when
integration
is active'
do
before
do
subject
.
active
=
true
end
...
...
@@ -14,7 +14,7 @@ RSpec.describe Integrations::EmailsOnPush do
it
{
is_expected
.
to
validate_presence_of
(
:recipients
)
}
end
context
'when
service
is inactive'
do
context
'when
integration
is inactive'
do
before
do
subject
.
active
=
false
end
...
...
@@ -27,7 +27,7 @@ RSpec.describe Integrations::EmailsOnPush do
stub_const
(
"
#{
described_class
}
::RECIPIENTS_LIMIT"
,
2
)
end
subject
(
:
service
)
{
described_class
.
new
(
project:
project
,
recipients:
recipients
,
active:
true
)
}
subject
(
:
integration
)
{
described_class
.
new
(
project:
project
,
recipients:
recipients
,
active:
true
)
}
context
'valid number of recipients'
do
let
(
:recipients
)
{
'foo@bar.com duplicate@example.com Duplicate@example.com invalid-email'
}
...
...
@@ -43,14 +43,14 @@ RSpec.describe Integrations::EmailsOnPush do
it
{
is_expected
.
not_to
be_valid
}
it
'adds an error message'
do
service
.
valid?
integration
.
valid?
expect
(
service
.
errors
).
to
contain_exactly
(
'Recipients can\'t exceed 2'
)
expect
(
integration
.
errors
).
to
contain_exactly
(
'Recipients can\'t exceed 2'
)
end
context
'when
service
is not active'
do
context
'when
integration
is not active'
do
before
do
service
.
active
=
false
integration
.
active
=
false
end
it
{
is_expected
.
to
be_valid
}
...
...
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