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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
49295924
Commit
49295924
authored
Mar 03, 2016
by
tiagonbotelho
Committed by
Yorick Peterse
Mar 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds test for git push service for updating the language of the project
parent
4e8a5343
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
app/services/git_push_service.rb
app/services/git_push_service.rb
+5
-3
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+17
-0
No files found.
app/services/git_push_service.rb
View file @
49295924
...
...
@@ -51,16 +51,18 @@ class GitPushService < BaseService
update_merge_requests
end
protected
def
update_main_language
current_language
=
@project
.
repository
.
main_language
unless
current_language
==
@project
.
main_language
@project
.
update_attributes
(
main_language:
current_language
)
return
@project
.
update_attributes
(
main_language:
current_language
)
end
true
end
protected
def
update_merge_requests
@project
.
update_merge_requests
(
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
current_user
)
...
...
spec/services/git_push_service_spec.rb
View file @
49295924
...
...
@@ -155,6 +155,23 @@ describe GitPushService, services: true do
end
end
describe
"Updates main language"
do
context
"before push"
do
it
{
expect
(
project
.
main_language
).
to
eq
(
nil
)
}
end
context
"after push"
do
before
do
@service
=
execute_service
(
project
,
user
,
@oldrev
,
@newrev
,
@ref
)
end
it
{
expect
(
@service
.
update_main_language
).
to
eq
(
true
)
}
it
{
expect
(
project
.
main_language
).
to
eq
(
"Ruby"
)
}
end
end
describe
"Web Hooks"
do
context
"execute web hooks"
do
it
"when pushing a branch for the first time"
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