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
53907f24
Commit
53907f24
authored
Mar 21, 2019
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE lines in emails service specs to ee/
parent
c6de49fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
16 deletions
+40
-16
ee/spec/services/emails/create_service_spec.rb
ee/spec/services/emails/create_service_spec.rb
+18
-0
ee/spec/services/emails/destroy_service_spec.rb
ee/spec/services/emails/destroy_service_spec.rb
+18
-0
spec/services/emails/create_service_spec.rb
spec/services/emails/create_service_spec.rb
+2
-8
spec/services/emails/destroy_service_spec.rb
spec/services/emails/destroy_service_spec.rb
+2
-8
No files found.
ee/spec/services/emails/create_service_spec.rb
0 → 100644
View file @
53907f24
# frozen_string_literal: true
require
'spec_helper'
describe
Emails
::
CreateService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:opts
)
{
{
email:
'new@email.com'
,
user:
user
}
}
subject
(
:service
)
{
described_class
.
new
(
user
,
opts
)
}
describe
'#execute'
do
it
'registers a security event'
do
stub_licensed_features
(
extended_audit_events:
true
)
expect
{
service
.
execute
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
end
end
end
ee/spec/services/emails/destroy_service_spec.rb
0 → 100644
View file @
53907f24
# frozen_string_literal: true
require
'spec_helper'
describe
Emails
::
DestroyService
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:email
)
{
create
(
:email
,
user:
user
)
}
subject
(
:service
)
{
described_class
.
new
(
user
,
user:
user
)
}
describe
'#execute'
do
it
'registers a security event'
do
stub_licensed_features
(
extended_audit_events:
true
)
expect
{
service
.
execute
(
email
)
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
end
end
end
spec/services/emails/create_service_spec.rb
View file @
53907f24
# frozen_string_literal: true
require
'spec_helper'
describe
Emails
::
CreateService
do
...
...
@@ -7,10 +9,6 @@ describe Emails::CreateService do
subject
(
:service
)
{
described_class
.
new
(
user
,
opts
)
}
describe
'#execute'
do
before
do
stub_licensed_features
(
extended_audit_events:
true
)
end
it
'creates an email with valid attributes'
do
expect
{
service
.
execute
}.
to
change
{
Email
.
count
}.
by
(
1
)
expect
(
Email
.
where
(
opts
)).
not_to
be_empty
...
...
@@ -26,9 +24,5 @@ describe Emails::CreateService do
expect
(
user
.
emails
).
to
eq
(
Email
.
where
(
opts
))
end
it
'registers a security event'
do
expect
{
service
.
execute
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
end
end
end
spec/services/emails/destroy_service_spec.rb
View file @
53907f24
# frozen_string_literal: true
require
'spec_helper'
describe
Emails
::
DestroyService
do
...
...
@@ -6,17 +8,9 @@ describe Emails::DestroyService do
subject
(
:service
)
{
described_class
.
new
(
user
,
user:
user
)
}
before
do
stub_licensed_features
(
extended_audit_events:
true
)
end
describe
'#execute'
do
it
'removes an email'
do
expect
{
service
.
execute
(
email
)
}.
to
change
{
user
.
emails
.
count
}.
by
(
-
1
)
end
it
'registers a security event'
do
expect
{
service
.
execute
(
email
)
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
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