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
c67e3067
Commit
c67e3067
authored
Apr 10, 2014
by
Jonathan A. Sternberg
Committed by
Marin Jankovski
Apr 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix emails on push service when a single commit is pushed
Conflicts: CHANGELOG
parent
2f5b6e13
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
+41
-2
CHANGELOG
CHANGELOG
+3
-0
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+37
-1
No files found.
CHANGELOG
View file @
c67e3067
v 6.7.5
- Fix emails on push service when only one commit is pushed (Jonathan Sternberg)
v 6.7.4
- Don't send an email for "mentioned in" notes (Pierre de La Morinerie)
...
...
app/mailers/emails/projects.rb
View file @
c67e3067
...
...
@@ -26,7 +26,7 @@ module Emails
if
@commits
.
length
>
1
@target_url
=
project_compare_url
(
@project
,
from:
@commits
.
first
,
to:
@commits
.
last
)
else
@target_url
=
project_commit_url
(
@project
,
@com
pare
.
commi
t
)
@target_url
=
project_commit_url
(
@project
,
@com
mits
.
firs
t
)
end
mail
(
from:
sender
(
author_id
),
...
...
spec/mailers/notify_spec.rb
View file @
c67e3067
...
...
@@ -502,7 +502,7 @@ describe Notify do
end
end
describe
'email on push'
do
describe
'email on push
with multiple commits
'
do
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:compare
)
{
Gitlab
::
Git
::
Compare
.
new
(
project
.
repository
.
raw_repository
,
'cd5c4bac'
,
'b1e6a9db'
)
}
...
...
@@ -537,4 +537,40 @@ describe Notify do
should
have_body_text
/
#{
diff_path
}
/
end
end
describe
'email on push with a single commit'
do
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:compare
)
{
Gitlab
::
Git
::
Compare
.
new
(
project
.
repository
.
raw_repository
,
'8716fc78'
,
'b1e6a9db'
)
}
let
(
:commits
)
{
Commit
.
decorate
(
compare
.
commits
)
}
let
(
:diff_path
)
{
project_commit_path
(
project
,
commits
.
first
)
}
subject
{
Notify
.
repository_push_email
(
project
.
id
,
'devs@company.name'
,
user
.
id
,
'master'
,
compare
)
}
it
'is sent as the author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
sender
.
display_name
.
should
eq
(
user
.
name
)
sender
.
address
.
should
eq
(
gitlab_sender
)
end
it
'is sent to recipient'
do
should
deliver_to
'devs@company.name'
end
it
'has the correct subject'
do
should
have_subject
/New push to repository/
end
it
'includes commits list'
do
should
have_body_text
/tree css fixes/
end
it
'includes diffs'
do
should
have_body_text
/Checkout wiki pages for installation information/
end
it
'contains a link to the diff'
do
should
have_body_text
/
#{
diff_path
}
/
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