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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
4a3b18cb
Commit
4a3b18cb
authored
Aug 10, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move the member spec to be with the other ones
and add one
parent
b0600b01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
30 deletions
+52
-30
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+52
-30
No files found.
spec/services/notification_service_spec.rb
View file @
4a3b18cb
...
...
@@ -472,36 +472,6 @@ describe NotificationService, :mailer do
end
end
describe
'Members'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
(
:added_user
)
{
create
(
:user
)
}
def
create_member!
GroupMember
.
create
(
group:
group
,
user:
added_user
,
access_level:
Gitlab
::
Access
::
GUEST
)
end
it
'sends a notification'
do
create_member!
should_only_email
(
added_user
)
end
describe
'when notifications are disabled'
do
before
do
create_global_setting_for
(
added_user
,
:disabled
)
end
it
'does not send a notification'
do
create_member!
should_not_email_anyone
end
end
end
describe
'Issues'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
...
...
@@ -1267,6 +1237,35 @@ describe NotificationService, :mailer do
end
.
to
change
{
ActionMailer
::
Base
.
deliveries
.
size
}.
by
(
1
)
end
end
describe
'#new_group_member'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:added_user
)
{
create
(
:user
)
}
def
create_member!
GroupMember
.
create
(
group:
group
,
user:
added_user
,
access_level:
Gitlab
::
Access
::
GUEST
)
end
it
'sends a notification'
do
create_member!
should_only_email
(
added_user
)
end
describe
'when notifications are disabled'
do
before
do
create_global_setting_for
(
added_user
,
:disabled
)
end
it
'does not send a notification'
do
create_member!
should_not_email_anyone
end
end
end
end
describe
'ProjectMember'
do
...
...
@@ -1286,6 +1285,29 @@ describe NotificationService, :mailer do
end
.
to
change
{
ActionMailer
::
Base
.
deliveries
.
size
}.
by
(
1
)
end
end
describe
'#new_project_member'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:added_user
)
{
create
(
:user
)
}
def
create_member!
create
(
:project_member
,
user:
added_user
,
project:
project
)
end
it
do
create_member!
should_only_email
(
added_user
)
end
describe
'when notifications are disabled'
do
before
{
create_global_setting_for
(
added_user
,
:disabled
)
}
it
do
create_member!
should_not_email_anyone
end
end
end
end
context
'guest user in private project'
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