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
d7256552
Commit
d7256552
authored
Aug 03, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2017-08-03
parents
aa9843b8
4afbcb28
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
150 additions
and
128 deletions
+150
-128
app/assets/javascripts/commons/bootstrap.js
app/assets/javascripts/commons/bootstrap.js
+1
-0
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+42
-0
app/assets/javascripts/init_geo_info_modal.js
app/assets/javascripts/init_geo_info_modal.js
+26
-0
app/assets/javascripts/init_group_analytics.js
app/assets/javascripts/init_group_analytics.js
+34
-0
app/views/admin/licenses/new.html.haml
app/views/admin/licenses/new.html.haml
+0
-18
app/views/groups/analytics/show.html.haml
app/views/groups/analytics/show.html.haml
+7
-21
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+5
-5
app/views/projects/ee/_merge_request_settings.html.haml
app/views/projects/ee/_merge_request_settings.html.haml
+0
-3
app/views/shared/_geo_info_modal.html.haml
app/views/shared/_geo_info_modal.html.haml
+0
-16
changelogs/unreleased/fix-oauth-checkboxes.yml
changelogs/unreleased/fix-oauth-checkboxes.yml
+4
-0
doc/administration/job_artifacts.md
doc/administration/job_artifacts.md
+3
-3
doc/user/project/protected_branches.md
doc/user/project/protected_branches.md
+4
-8
spec/features/admin/admin_settings_spec.rb
spec/features/admin/admin_settings_spec.rb
+8
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+1
-5
spec/models/deploy_key_spec.rb
spec/models/deploy_key_spec.rb
+1
-3
spec/models/gpg_key_spec.rb
spec/models/gpg_key_spec.rb
+1
-3
spec/models/key_spec.rb
spec/models/key_spec.rb
+1
-3
spec/models/project_services/pipelines_email_service_spec.rb
spec/models/project_services/pipelines_email_service_spec.rb
+1
-7
spec/requests/api/ee/issues_spec.rb
spec/requests/api/ee/issues_spec.rb
+1
-3
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+1
-3
spec/requests/api/v3/issues_spec.rb
spec/requests/api/v3/issues_spec.rb
+1
-3
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+1
-3
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+1
-3
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+4
-7
spec/support/notify_shared_examples.rb
spec/support/notify_shared_examples.rb
+0
-1
spec/support/updating_mentions_shared_examples.rb
spec/support/updating_mentions_shared_examples.rb
+0
-2
spec/workers/emails_on_push_worker_spec.rb
spec/workers/emails_on_push_worker_spec.rb
+1
-5
spec/workers/pipeline_notification_worker_spec.rb
spec/workers/pipeline_notification_worker_spec.rb
+1
-3
No files found.
app/assets/javascripts/commons/bootstrap.js
View file @
d7256552
...
@@ -9,6 +9,7 @@ import 'bootstrap-sass/assets/javascripts/bootstrap/tab';
...
@@ -9,6 +9,7 @@ import 'bootstrap-sass/assets/javascripts/bootstrap/tab';
import
'
bootstrap-sass/assets/javascripts/bootstrap/transition
'
;
import
'
bootstrap-sass/assets/javascripts/bootstrap/transition
'
;
import
'
bootstrap-sass/assets/javascripts/bootstrap/tooltip
'
;
import
'
bootstrap-sass/assets/javascripts/bootstrap/tooltip
'
;
import
'
bootstrap-sass/assets/javascripts/bootstrap/popover
'
;
import
'
bootstrap-sass/assets/javascripts/bootstrap/popover
'
;
import
'
bootstrap-sass/assets/javascripts/bootstrap/button
'
;
// custom jQuery functions
// custom jQuery functions
$
.
fn
.
extend
({
$
.
fn
.
extend
({
...
...
app/assets/javascripts/dispatcher.js
View file @
d7256552
...
@@ -84,6 +84,8 @@ import initIssuableSidebar from './init_issuable_sidebar';
...
@@ -84,6 +84,8 @@ import initIssuableSidebar from './init_issuable_sidebar';
// EE-only
// EE-only
import
ApproversSelect
from
'
./approvers_select
'
;
import
ApproversSelect
from
'
./approvers_select
'
;
import
AuditLogs
from
'
./audit_logs
'
;
import
AuditLogs
from
'
./audit_logs
'
;
import
initGeoInfoModal
from
'
./init_geo_info_modal
'
;
import
initGroupAnalytics
from
'
./init_group_analytics
'
;
(
function
()
{
(
function
()
{
var
Dispatcher
;
var
Dispatcher
;
...
@@ -121,6 +123,19 @@ import AuditLogs from './audit_logs';
...
@@ -121,6 +123,19 @@ import AuditLogs from './audit_logs';
});
});
});
});
function
initBlobEE
()
{
const
dataEl
=
document
.
getElementById
(
'
js-file-lock
'
);
if
(
dataEl
)
{
const
{
toggle_path
,
path
,
}
=
JSON
.
parse
(
dataEl
.
innerHTML
);
PathLocks
.
init
(
toggle_path
,
path
);
}
}
function
initBlob
()
{
function
initBlob
()
{
new
LineHighlighter
();
new
LineHighlighter
();
...
@@ -146,6 +161,8 @@ import AuditLogs from './audit_logs';
...
@@ -146,6 +161,8 @@ import AuditLogs from './audit_logs';
actionTextPieces
:
document
.
querySelectorAll
(
'
.js-file-fork-suggestion-section-action
'
),
actionTextPieces
:
document
.
querySelectorAll
(
'
.js-file-fork-suggestion-section-action
'
),
})
})
.
init
();
.
init
();
initBlobEE
();
}
}
const
filteredSearchEnabled
=
gl
.
FilteredSearchManager
&&
document
.
querySelector
(
'
.filtered-search
'
);
const
filteredSearchEnabled
=
gl
.
FilteredSearchManager
&&
document
.
querySelector
(
'
.filtered-search
'
);
...
@@ -352,8 +369,13 @@ import AuditLogs from './audit_logs';
...
@@ -352,8 +369,13 @@ import AuditLogs from './audit_logs';
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
GpgBadges
.
fetch
();
GpgBadges
.
fetch
();
break
;
break
;
<<<<<<<
HEAD
case
'
projects:edit
'
:
case
'
projects:edit
'
:
new
UsersSelect
();
new
UsersSelect
();
=======
case
'
projects:imports:show
'
:
new
ProjectImport
();
>>>>>>>
upstream
/
master
break
;
break
;
case
'
projects:show
'
:
case
'
projects:show
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
...
@@ -364,8 +386,11 @@ import AuditLogs from './audit_logs';
...
@@ -364,8 +386,11 @@ import AuditLogs from './audit_logs';
if
(
$
(
'
.blob-viewer
'
).
length
)
{
if
(
$
(
'
.blob-viewer
'
).
length
)
{
new
BlobViewer
();
new
BlobViewer
();
}
}
initGeoInfoModal
();
break
;
break
;
case
'
projects:edit
'
:
case
'
projects:edit
'
:
new
UsersSelect
();
new
GroupsSelect
();
setupProjectEdit
();
setupProjectEdit
();
break
;
break
;
case
'
projects:imports:show
'
:
case
'
projects:imports:show
'
:
...
@@ -542,6 +567,23 @@ import AuditLogs from './audit_logs';
...
@@ -542,6 +567,23 @@ import AuditLogs from './audit_logs';
case
'
admin:impersonation_tokens:index
'
:
case
'
admin:impersonation_tokens:index
'
:
new
gl
.
DueDateSelectors
();
new
gl
.
DueDateSelectors
();
break
;
break
;
case
'
admin:licenses:new
'
:
const
$licenseFile
=
$
(
'
.license-file
'
);
const
$licenseKey
=
$
(
'
.license-key
'
);
const
showLicenseType
=
()
=>
{
const
$checkedFile
=
$
(
'
input[name="license_type"]:checked
'
).
val
()
===
'
file
'
;
$licenseFile
.
toggle
(
$checkedFile
);
$licenseKey
.
toggle
(
!
$checkedFile
);
};
$
(
'
input[name="license_type"]
'
).
on
(
'
change
'
,
showLicenseType
);
showLicenseType
();
break
;
case
'
groups:analytics:show
'
:
initGroupAnalytics
();
break
;
}
}
switch
(
path
.
first
())
{
switch
(
path
.
first
())
{
case
'
sessions
'
:
case
'
sessions
'
:
...
...
app/assets/javascripts/init_geo_info_modal.js
0 → 100644
View file @
d7256552
export
default
()
=>
{
const
$modal
=
$
(
'
#modal-geo-info
'
);
if
(
!
$modal
.
length
)
return
;
$modal
.
appendTo
(
'
body
'
)
.
modal
({
modal
:
true
,
show
:
false
,
})
.
on
(
'
show.bs.modal
'
,
(
e
)
=>
{
const
{
cloneUrlPrimary
,
cloneUrlSecondary
,
}
=
$
(
e
.
currentTarget
).
data
();
$
(
'
#geo-info-1
'
).
text
(
`git clone
${(
cloneUrlSecondary
||
'
<clone url for secondary repository>
'
)}
`
,
);
$
(
'
#geo-info-2
'
).
text
(
`git remote set-url --push origin
${(
cloneUrlPrimary
||
'
<clone url for primary repository>
'
)}
`
,
);
});
};
app/assets/javascripts/init_group_analytics.js
0 → 100644
View file @
d7256552
/* global Chart */
export
default
()
=>
{
const
dataEl
=
document
.
getElementById
(
'
js-analytics-data
'
);
const
data
=
JSON
.
parse
(
dataEl
.
innerHTML
);
const
labels
=
data
.
labels
;
const
outputElIds
=
[
'
push
'
,
'
issues_closed
'
,
'
merge_requests_created
'
];
outputElIds
.
forEach
((
id
)
=>
{
const
el
=
document
.
getElementById
(
id
);
const
ctx
=
el
.
getContext
(
'
2d
'
);
const
chart
=
new
Chart
(
ctx
);
chart
.
Bar
(
{
labels
,
datasets
:
[{
fillColor
:
'
rgba(220,220,220,0.5)
'
,
strokeColor
:
'
rgba(220,220,220,1)
'
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
data
[
id
].
data
,
}],
},
{
scaleOverlay
:
true
,
responsive
:
true
,
maintainAspectRatio
:
false
,
},
);
});
$
(
'
#event-stats
'
).
tablesorter
();
};
app/views/admin/licenses/new.html.haml
View file @
d7256552
...
@@ -38,21 +38,3 @@
...
@@ -38,21 +38,3 @@
.form-actions
.form-actions
=
f
.
submit
'Upload license'
,
class:
'btn btn-primary'
=
f
.
submit
'Upload license'
,
class:
'btn btn-primary'
:javascript
function
showLicenseType
()
{
if
(
$
(
"
input[name='license_type']:checked
"
).
val
()
==
"
file
"
)
{
$
(
"
.license-file
"
).
show
();
$
(
"
.license-key
"
).
hide
();
}
else
{
$
(
"
.license-file
"
).
hide
();
$
(
"
.license-key
"
).
show
();
}
}
$
(
"
input[name='license_type']
"
).
click
(
showLicenseType
);
showLicenseType
();
app/views/groups/analytics/show.html.haml
View file @
d7256552
...
@@ -121,24 +121,10 @@
...
@@ -121,24 +121,10 @@
%td
=
@stats
[
:total_events
][
index
]
%td
=
@stats
[
:total_events
][
index
]
%script
#js-analytics-data
{
type:
"application/json"
}
-
[
:push
,
:issues_closed
,
:merge_requests_created
].
each
do
|
scope
|
-
data
=
{}
:javascript
-
data
[
:labels
]
=
@users
.
map
(
&
:name
)
var
data
=
{
-
[
:push
,
:issues_closed
,
:merge_requests_created
].
each
do
|
scope
|
labels
:
#{
@users
.
map
(
&
:name
).
to_json
}
,
-
data
[
scope
]
=
{}
datasets
:
[
-
data
[
scope
][
:data
]
=
@stats
[
scope
]
{
=
data
.
to_json
.
html_safe
fillColor
:
"
rgba(220,220,220,0.5)
"
,
strokeColor
:
"
rgba(220,220,220,1)
"
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
#{
@stats
[
scope
].
to_json
}
}
]
}
var
ctx
=
$
(
"
##{scope}
"
).
get
(
0
).
getContext
(
"
2d
"
);
new
Chart
(
ctx
).
Bar
(
data
,{
"
scaleOverlay
"
:
true
,
responsive
:
true
,
maintainAspectRatio
:
false
});
:javascript
$
(
"
#event-stats
"
).
tablesorter
();
app/views/projects/blob/_header.html.haml
View file @
d7256552
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
=
render
'projects/fork_suggestion'
=
render
'projects/fork_suggestion'
-
if
@project
.
feature_available?
(
:file_locks
)
-
if
@project
.
feature_available?
(
:file_locks
)
:javascript
%script
#js-file-lock
{
type:
"application/json"
}
PathLocks
.
init
(
-
data
=
{}
'
#{
toggle_project_path_locks_path
(
@project
)
}
'
,
-
data
[
:path
]
=
@path
'
#{
@path
}
'
-
data
[
:toggle_path
]
=
toggle_project_path_locks_path
(
@project
)
);
=
data
.
to_json
.
html_safe
app/views/projects/ee/_merge_request_settings.html.haml
View file @
d7256552
...
@@ -49,6 +49,3 @@
...
@@ -49,6 +49,3 @@
Description parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
'user/markdown'
),
target:
'_blank'
}
.
Description parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
'user/markdown'
),
target:
'_blank'
}
.
=
render
'projects/ee/merge_request_approvals_settings'
,
project:
project
,
form:
form
=
render
'projects/ee/merge_request_approvals_settings'
,
project:
project
,
form:
form
:javascript
new
GroupsSelect
();
app/views/shared/_geo_info_modal.html.haml
View file @
d7256552
...
@@ -27,19 +27,3 @@
...
@@ -27,19 +27,3 @@
%p
%p
%strong
=
'Done.'
%strong
=
'Done.'
You can now commit and push code as you normally do, but with increased speed.
You can now commit and push code as you normally do, but with increased speed.
:javascript
$
(
'
#modal-geo-info
'
)
.
appendTo
(
'
body
'
)
.
modal
({
modal
:
true
,
show
:
false
})
.
on
(
'
show.bs.modal
'
,
function
()
{
var
data
=
$
(
this
).
data
();
$
(
'
#geo-info-1
'
).
text
(
'
git clone
'
+
(
data
.
cloneUrlSecondary
||
'
<clone url for secondary repository>
'
)
);
$
(
'
#geo-info-2
'
).
text
(
'
git remote set-url --push origin
'
+
(
data
.
cloneUrlPrimary
||
'
<clone url for primary repository>
'
)
);
});
changelogs/unreleased/fix-oauth-checkboxes.yml
0 → 100644
View file @
d7256552
---
title
:
Fixed sign-in restrictions buttons not toggling active state
merge_request
:
author
:
doc/administration/job_artifacts.md
View file @
d7256552
...
@@ -107,9 +107,9 @@ _The artifacts are stored by default in
...
@@ -107,9 +107,9 @@ _The artifacts are stored by default in
```ruby
```ruby
gitlab_rails['artifacts_enabled'] = true
gitlab_rails['artifacts_enabled'] = true
gitlab_rails['artifacts
']['object_store_enabled'] = fals
e
gitlab_rails['artifacts
_object_store_enabled'] = tru
e
gitlab_rails['artifacts
']['object_stor
e_directory'] = "artifacts"
gitlab_rails['artifacts
_object_store_remot
e_directory'] = "artifacts"
gitlab_rails['artifacts
']['
object_store_connection'] = {
gitlab_rails['artifacts
_
object_store_connection'] = {
'provider' => 'AWS',
'provider' => 'AWS',
'region' => 'eu-central-1',
'region' => 'eu-central-1',
'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
...
...
doc/user/project/protected_branches.md
View file @
d7256552
...
@@ -15,16 +15,11 @@ By default, a protected branch does four simple things:
...
@@ -15,16 +15,11 @@ By default, a protected branch does four simple things:
-
it prevents
**anyone**
from force pushing to the branch
-
it prevents
**anyone**
from force pushing to the branch
-
it prevents
**anyone**
from deleting the branch
-
it prevents
**anyone**
from deleting the branch
**Note**
: A GitLab admin is allowed to push to the protected branches.
>**Note**:
A GitLab admin is allowed to push to the protected branches.
See the
[
Changelog
](
#changelog
)
section for changes over time.
See the
[
Changelog
](
#changelog
)
section for changes over time.
>
>Additional functionality for GitLab Enterprise Edition:
>
>- Restrict push and merge access to [certain users][ee-restrict]
## Configuring protected branches
## Configuring protected branches
To protect a branch, you need to have at least Master permission level. Note
To protect a branch, you need to have at least Master permission level. Note
...
@@ -73,7 +68,7 @@ they are set to "Masters" by default.
...
@@ -73,7 +68,7 @@ they are set to "Masters" by default.
## Restricting push and merge access to certain users
## Restricting push and merge access to certain users
> This feature was [introduced][ce-5081] in
GitLab Enterprise Edition
8.11.
> This feature was [introduced][ce-5081] in
[GitLab Enterprise Edition Starter][ee]
8.11.
With GitLab Enterprise Edition you can restrict access to protected branches
With GitLab Enterprise Edition you can restrict access to protected branches
by choosing a role (Masters, Developers) as well as certain users. From the
by choosing a role (Masters, Developers) as well as certain users. From the
...
@@ -156,3 +151,4 @@ command line or a Git client application.
...
@@ -156,3 +151,4 @@ command line or a Git client application.
[
ce-21393
]:
https://gitlab.com/gitlab-org/gitlab-ce/issues/21393
[
ce-21393
]:
https://gitlab.com/gitlab-org/gitlab-ce/issues/21393
[
ee-restrict
]:
http://docs.gitlab.com/ee/user/project/protected_branches.html#restricting-push-and-merge-access-to-certain-users
[
ee-restrict
]:
http://docs.gitlab.com/ee/user/project/protected_branches.html#restricting-push-and-merge-access-to-certain-users
[
perm
]:
../permissions.md
[
perm
]:
../permissions.md
[
ee
]:
https://about.gitlab.com/gitlab-ee/
spec/features/admin/admin_settings_spec.rb
View file @
d7256552
...
@@ -92,6 +92,14 @@ feature 'Admin updates settings' do
...
@@ -92,6 +92,14 @@ feature 'Admin updates settings' do
expect
(
find
(
'#service_push_channel'
).
value
).
to
eq
'#test_channel'
expect
(
find
(
'#service_push_channel'
).
value
).
to
eq
'#test_channel'
end
end
context
'sign-in restrictions'
,
:js
do
it
'de-activates oauth sign-in source'
do
find
(
'.btn'
,
text:
'GitLab.com'
).
click
expect
(
find
(
'.btn'
,
text:
'GitLab.com'
)).
not_to
have_css
(
'.active'
)
end
end
def
check_all_events
def
check_all_events
page
.
check
(
'Active'
)
page
.
check
(
'Active'
)
page
.
check
(
'Push'
)
page
.
check
(
'Push'
)
...
...
spec/models/ci/pipeline_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
Ci
::
Pipeline
do
describe
Ci
::
Pipeline
,
:mailer
do
include
EmailHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
...
@@ -1252,8 +1250,6 @@ describe Ci::Pipeline do
...
@@ -1252,8 +1250,6 @@ describe Ci::Pipeline do
pipeline
.
user
.
global_notification_setting
pipeline
.
user
.
global_notification_setting
.
update
(
level:
'custom'
,
failed_pipeline:
true
,
success_pipeline:
true
)
.
update
(
level:
'custom'
,
failed_pipeline:
true
,
success_pipeline:
true
)
reset_delivered_emails!
perform_enqueued_jobs
do
perform_enqueued_jobs
do
pipeline
.
enqueue
pipeline
.
enqueue
pipeline
.
run
pipeline
.
run
...
...
spec/models/deploy_key_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
DeployKey
do
describe
DeployKey
,
:mailer
do
include
EmailHelpers
describe
"Associations"
do
describe
"Associations"
do
it
{
is_expected
.
to
have_many
(
:deploy_keys_projects
)
}
it
{
is_expected
.
to
have_many
(
:deploy_keys_projects
)
}
it
{
is_expected
.
to
have_many
(
:projects
)
}
it
{
is_expected
.
to
have_many
(
:projects
)
}
...
...
spec/models/gpg_key_spec.rb
View file @
d7256552
...
@@ -114,9 +114,7 @@ describe GpgKey do
...
@@ -114,9 +114,7 @@ describe GpgKey do
end
end
end
end
describe
'notification'
do
describe
'notification'
,
:mailer
do
include
EmailHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
it
'sends a notification'
do
it
'sends a notification'
do
...
...
spec/models/key_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
Key
do
describe
Key
,
:mailer
do
include
EmailHelpers
describe
"Associations"
do
describe
"Associations"
do
it
{
is_expected
.
to
belong_to
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
end
end
...
...
spec/models/project_services/pipelines_email_service_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
PipelinesEmailService
do
describe
PipelinesEmailService
,
:mailer
do
include
EmailHelpers
let
(
:pipeline
)
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
(
'master'
).
sha
)
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
(
'master'
).
sha
)
end
end
...
@@ -14,10 +12,6 @@ describe PipelinesEmailService do
...
@@ -14,10 +12,6 @@ describe PipelinesEmailService do
Gitlab
::
DataBuilder
::
Pipeline
.
build
(
pipeline
)
Gitlab
::
DataBuilder
::
Pipeline
.
build
(
pipeline
)
end
end
before
do
reset_delivered_emails!
end
describe
'Validations'
do
describe
'Validations'
do
context
'when service is active'
do
context
'when service is active'
do
before
do
before
do
...
...
spec/requests/api/ee/issues_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
API
::
Issues
do
# rubocop:disable RSpec/FilePath
describe
API
::
Issues
,
:mailer
do
# rubocop:disable RSpec/FilePath
include
EmailHelpers
set
(
:user
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
do
set
(
:project
)
do
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
...
...
spec/requests/api/issues_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
API
::
Issues
do
describe
API
::
Issues
,
:mailer
do
include
EmailHelpers
set
(
:user
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
do
set
(
:project
)
do
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
...
...
spec/requests/api/v3/issues_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
API
::
V3
::
Issues
do
describe
API
::
V3
::
Issues
,
:mailer
do
include
EmailHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:non_member
)
{
create
(
:user
)
}
let
(
:non_member
)
{
create
(
:user
)
}
...
...
spec/services/issues/update_service_spec.rb
View file @
d7256552
# coding: utf-8
# coding: utf-8
require
'spec_helper'
require
'spec_helper'
describe
Issues
::
UpdateService
do
describe
Issues
::
UpdateService
,
:mailer
do
include
EmailHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
MergeRequests
::
UpdateService
do
describe
MergeRequests
::
UpdateService
,
:mailer
do
include
EmailHelpers
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
...
...
spec/services/notification_service_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
NotificationService
do
describe
NotificationService
,
:mailer
do
include
EmailHelpers
let
(
:notification
)
{
described_class
.
new
}
let
(
:notification
)
{
described_class
.
new
}
let
(
:assignee
)
{
create
(
:user
)
}
let
(
:assignee
)
{
create
(
:user
)
}
...
@@ -14,7 +12,6 @@ describe NotificationService do
...
@@ -14,7 +12,6 @@ describe NotificationService do
shared_examples
'notifications for new mentions'
do
shared_examples
'notifications for new mentions'
do
def
send_notifications
(
*
new_mentions
)
def
send_notifications
(
*
new_mentions
)
reset_delivered_emails!
notification
.
send
(
notification_method
,
mentionable
,
new_mentions
,
@u_disabled
)
notification
.
send
(
notification_method
,
mentionable
,
new_mentions
,
@u_disabled
)
end
end
...
@@ -137,12 +134,11 @@ describe NotificationService do
...
@@ -137,12 +134,11 @@ describe NotificationService do
describe
'#new_note'
do
describe
'#new_note'
do
it
do
it
do
add_users_with_subscription
(
note
.
project
,
issue
)
add_users_with_subscription
(
note
.
project
,
issue
)
reset_delivered_emails!
# Ensure create SentNotification by noteable = issue 6 times, not noteable = note
# Ensure create SentNotification by noteable = issue 6 times, not noteable = note
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
issue
,
any_args
).
exactly
(
8
).
times
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
issue
,
any_args
).
exactly
(
8
).
times
reset_delivered_emails!
notification
.
new_note
(
note
)
notification
.
new_note
(
note
)
should_email
(
@u_watcher
)
should_email
(
@u_watcher
)
...
@@ -165,9 +161,10 @@ describe NotificationService do
...
@@ -165,9 +161,10 @@ describe NotificationService do
it
"emails the note author if they've opted into notifications about their activity"
do
it
"emails the note author if they've opted into notifications about their activity"
do
add_users_with_subscription
(
note
.
project
,
issue
)
add_users_with_subscription
(
note
.
project
,
issue
)
note
.
author
.
notified_of_own_activity
=
true
reset_delivered_emails!
reset_delivered_emails!
note
.
author
.
notified_of_own_activity
=
true
notification
.
new_note
(
note
)
notification
.
new_note
(
note
)
should_email
(
note
.
author
)
should_email
(
note
.
author
)
...
...
spec/support/notify_shared_examples.rb
View file @
d7256552
...
@@ -7,7 +7,6 @@ shared_context 'gitlab email notification' do
...
@@ -7,7 +7,6 @@ shared_context 'gitlab email notification' do
let
(
:new_user_address
)
{
'newguy@example.com'
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
before
do
before
do
reset_delivered_emails!
email
=
recipient
.
emails
.
create
(
email:
"notifications@example.com"
)
email
=
recipient
.
emails
.
create
(
email:
"notifications@example.com"
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
stub_incoming_email_setting
(
enabled:
true
,
address:
"reply+%{key}@
#{
Gitlab
.
config
.
gitlab
.
host
}
"
)
stub_incoming_email_setting
(
enabled:
true
,
address:
"reply+%{key}@
#{
Gitlab
.
config
.
gitlab
.
host
}
"
)
...
...
spec/support/updating_mentions_shared_examples.rb
View file @
d7256552
...
@@ -7,8 +7,6 @@ RSpec.shared_examples 'updating mentions' do |service_class|
...
@@ -7,8 +7,6 @@ RSpec.shared_examples 'updating mentions' do |service_class|
end
end
def
update_mentionable
(
opts
)
def
update_mentionable
(
opts
)
reset_delivered_emails!
perform_enqueued_jobs
do
perform_enqueued_jobs
do
service_class
.
new
(
project
,
user
,
opts
).
execute
(
mentionable
)
service_class
.
new
(
project
,
user
,
opts
).
execute
(
mentionable
)
end
end
...
...
spec/workers/emails_on_push_worker_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
EmailsOnPushWorker
do
describe
EmailsOnPushWorker
,
:mailer
do
include
RepoHelpers
include
RepoHelpers
include
EmailHelpers
include
EmailSpec
::
Matchers
include
EmailSpec
::
Matchers
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
...
@@ -90,7 +89,6 @@ describe EmailsOnPushWorker do
...
@@ -90,7 +89,6 @@ describe EmailsOnPushWorker do
context
"when there is an SMTP error"
do
context
"when there is an SMTP error"
do
before
do
before
do
reset_delivered_emails!
allow
(
Notify
).
to
receive
(
:repository_push_email
).
and_raise
(
Net
::
SMTPFatalError
)
allow
(
Notify
).
to
receive
(
:repository_push_email
).
and_raise
(
Net
::
SMTPFatalError
)
allow
(
subject
).
to
receive_message_chain
(
:logger
,
:info
)
allow
(
subject
).
to
receive_message_chain
(
:logger
,
:info
)
perform
perform
...
@@ -114,8 +112,6 @@ describe EmailsOnPushWorker do
...
@@ -114,8 +112,6 @@ describe EmailsOnPushWorker do
allow_any_instance_of
(
Mail
::
TestMailer
).
to
receive
(
:deliver!
).
and_wrap_original
do
|
original
,
mail
|
allow_any_instance_of
(
Mail
::
TestMailer
).
to
receive
(
:deliver!
).
and_wrap_original
do
|
original
,
mail
|
original
.
call
(
Mail
.
new
(
mail
.
encoded
))
original
.
call
(
Mail
.
new
(
mail
.
encoded
))
end
end
reset_delivered_emails!
end
end
it
"sends the mail to each of the recipients"
do
it
"sends the mail to each of the recipients"
do
...
...
spec/workers/pipeline_notification_worker_spec.rb
View file @
d7256552
require
'spec_helper'
require
'spec_helper'
describe
PipelineNotificationWorker
do
describe
PipelineNotificationWorker
,
:mailer
do
include
EmailHelpers
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
describe
'#execute'
do
describe
'#execute'
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