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
5a883915
Commit
5a883915
authored
Sep 18, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard against regressions in commit email specs
parent
12f98792
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
5 deletions
+12
-5
app/models/project_wiki.rb
app/models/project_wiki.rb
+4
-3
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+3
-0
spec/services/files/create_service_spec.rb
spec/services/files/create_service_spec.rb
+1
-0
spec/services/files/delete_service_spec.rb
spec/services/files/delete_service_spec.rb
+2
-1
spec/services/files/update_service_spec.rb
spec/services/files/update_service_spec.rb
+2
-1
No files found.
app/models/project_wiki.rb
View file @
5a883915
...
@@ -184,11 +184,12 @@ class ProjectWiki
...
@@ -184,11 +184,12 @@ class ProjectWiki
def
commit_details
(
action
,
message
=
nil
,
title
=
nil
)
def
commit_details
(
action
,
message
=
nil
,
title
=
nil
)
commit_message
=
message
||
default_message
(
action
,
title
)
commit_message
=
message
||
default_message
(
action
,
title
)
git_user
=
Gitlab
::
Git
::
User
.
from_gitlab
(
@user
)
Gitlab
::
Git
::
Wiki
::
CommitDetails
.
new
(
@user
.
id
,
Gitlab
::
Git
::
Wiki
::
CommitDetails
.
new
(
@user
.
id
,
@
user
.
username
,
git_
user
.
username
,
@
user
.
name
,
git_
user
.
name
,
@user
.
commit_
email
,
git_user
.
email
,
commit_message
)
commit_message
)
end
end
...
...
spec/models/project_wiki_spec.rb
View file @
5a883915
...
@@ -280,6 +280,7 @@ describe ProjectWiki do
...
@@ -280,6 +280,7 @@ describe ProjectWiki do
it
'sets the correct commit email'
do
it
'sets the correct commit email'
do
subject
.
create_page
(
'test page'
,
'content'
)
subject
.
create_page
(
'test page'
,
'content'
)
expect
(
user
.
commit_email
).
not_to
eq
(
user
.
email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
end
end
...
@@ -329,6 +330,7 @@ describe ProjectWiki do
...
@@ -329,6 +330,7 @@ describe ProjectWiki do
end
end
it
'sets the correct commit email'
do
it
'sets the correct commit email'
do
expect
(
user
.
commit_email
).
not_to
eq
(
user
.
email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
end
end
...
@@ -363,6 +365,7 @@ describe ProjectWiki do
...
@@ -363,6 +365,7 @@ describe ProjectWiki do
it
'sets the correct commit email'
do
it
'sets the correct commit email'
do
subject
.
delete_page
(
@page
)
subject
.
delete_page
(
@page
)
expect
(
user
.
commit_email
).
not_to
eq
(
user
.
email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
end
end
...
...
spec/services/files/create_service_spec.rb
View file @
5a883915
...
@@ -84,6 +84,7 @@ describe Files::CreateService do
...
@@ -84,6 +84,7 @@ describe Files::CreateService do
it
'uses the commit email'
do
it
'uses the commit email'
do
subject
.
execute
subject
.
execute
expect
(
user
.
commit_email
).
not_to
eq
(
user
.
email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
end
end
...
...
spec/services/files/delete_service_spec.rb
View file @
5a883915
...
@@ -4,7 +4,7 @@ describe Files::DeleteService do
...
@@ -4,7 +4,7 @@ describe Files::DeleteService do
subject
{
described_class
.
new
(
project
,
user
,
commit_params
)
}
subject
{
described_class
.
new
(
project
,
user
,
commit_params
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
,
:commit_email
)
}
let
(
:file_path
)
{
'files/ruby/popen.rb'
}
let
(
:file_path
)
{
'files/ruby/popen.rb'
}
let
(
:branch_name
)
{
project
.
default_branch
}
let
(
:branch_name
)
{
project
.
default_branch
}
let
(
:last_commit_sha
)
{
nil
}
let
(
:last_commit_sha
)
{
nil
}
...
@@ -39,6 +39,7 @@ describe Files::DeleteService do
...
@@ -39,6 +39,7 @@ describe Files::DeleteService do
it
'uses the commit email'
do
it
'uses the commit email'
do
subject
.
execute
subject
.
execute
expect
(
user
.
commit_email
).
not_to
eq
(
user
.
email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
end
end
...
...
spec/services/files/update_service_spec.rb
View file @
5a883915
...
@@ -4,7 +4,7 @@ describe Files::UpdateService do
...
@@ -4,7 +4,7 @@ describe Files::UpdateService do
subject
{
described_class
.
new
(
project
,
user
,
commit_params
)
}
subject
{
described_class
.
new
(
project
,
user
,
commit_params
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
,
:commit_email
)
}
let
(
:file_path
)
{
'files/ruby/popen.rb'
}
let
(
:file_path
)
{
'files/ruby/popen.rb'
}
let
(
:new_contents
)
{
'New Content'
}
let
(
:new_contents
)
{
'New Content'
}
let
(
:branch_name
)
{
project
.
default_branch
}
let
(
:branch_name
)
{
project
.
default_branch
}
...
@@ -59,6 +59,7 @@ describe Files::UpdateService do
...
@@ -59,6 +59,7 @@ describe Files::UpdateService do
it
'uses the commit email'
do
it
'uses the commit email'
do
subject
.
execute
subject
.
execute
expect
(
user
.
commit_email
).
not_to
eq
(
user
.
email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
author_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
expect
(
commit
.
committer_email
).
to
eq
(
user
.
commit_email
)
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