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
Boxiang Sun
gitlab-ce
Commits
931c56f8
Commit
931c56f8
authored
Nov 17, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for merge request update.
parent
0fbf47a2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+1
-1
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+7
-4
No files found.
spec/services/issues/update_service_spec.rb
View file @
931c56f8
...
@@ -36,7 +36,7 @@ describe Issues::UpdateService do
...
@@ -36,7 +36,7 @@ describe Issues::UpdateService do
it
{
expect
(
@issue
.
labels
.
count
).
to
eq
(
1
)
}
it
{
expect
(
@issue
.
labels
.
count
).
to
eq
(
1
)
}
it
{
expect
(
@issue
.
labels
.
first
.
title
).
to
eq
(
'Bug'
)
}
it
{
expect
(
@issue
.
labels
.
first
.
title
).
to
eq
(
'Bug'
)
}
it
'should send email to user2 about assign of new issue and email to user about issue unassignment'
do
it
'should send email to user2 about assign of new issue and email to user
3
about issue unassignment'
do
deliveries
=
ActionMailer
::
Base
.
deliveries
deliveries
=
ActionMailer
::
Base
.
deliveries
email
=
deliveries
.
last
email
=
deliveries
.
last
recipients
=
deliveries
.
last
(
2
).
map
(
&
:to
).
flatten
recipients
=
deliveries
.
last
(
2
).
map
(
&
:to
).
flatten
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
931c56f8
...
@@ -3,7 +3,8 @@ require 'spec_helper'
...
@@ -3,7 +3,8 @@ require 'spec_helper'
describe
MergeRequests
::
UpdateService
do
describe
MergeRequests
::
UpdateService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
title:
'Old title'
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
title:
'Old title'
,
assignee_id:
user3
.
id
)
}
let
(
:project
)
{
merge_request
.
project
}
let
(
:project
)
{
merge_request
.
project
}
let
(
:label
)
{
create
(
:label
)
}
let
(
:label
)
{
create
(
:label
)
}
...
@@ -47,9 +48,11 @@ describe MergeRequests::UpdateService do
...
@@ -47,9 +48,11 @@ describe MergeRequests::UpdateService do
with
(
@merge_request
,
'update'
)
with
(
@merge_request
,
'update'
)
end
end
it
'should send email to user2 about assign of new merge_request'
do
it
'should send email to user2 about assign of new merge request and email to user3 about merge request unassignment'
do
email
=
ActionMailer
::
Base
.
deliveries
.
last
deliveries
=
ActionMailer
::
Base
.
deliveries
expect
(
email
.
to
.
first
).
to
eq
(
user2
.
email
)
email
=
deliveries
.
last
recipients
=
deliveries
.
last
(
2
).
map
(
&
:to
).
flatten
expect
(
recipients
).
to
include
(
user2
.
email
,
user3
.
email
)
expect
(
email
.
subject
).
to
include
(
merge_request
.
title
)
expect
(
email
.
subject
).
to
include
(
merge_request
.
title
)
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