Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
062863520cf9
Commit
3e046733
authored
Nov 10, 2012
by
randx
Browse files
Added feature test for stats
parent
260ac6d74dd1
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/views/repositories/stats.html.haml
View file @
06286352
...
...
@@ -16,9 +16,9 @@
%br
%div
#activity-chart
.span7
%h4
Top
10
0 Committers:
%h4
Top
5
0 Committers:
%ol
.styled
-
@stats
.
authors
[
0
...
10
0
].
each
do
|
author
|
-
@stats
.
authors
[
0
...
5
0
].
each
do
|
author
|
%li
=
image_tag
gravatar_icon
(
author
.
email
,
16
),
class:
'avatar s16'
=
author
.
name
...
...
features/project/commits/commits.feature
View file @
06286352
...
...
@@ -23,3 +23,7 @@ Feature: Project Browse commits
Scenario
:
I
browse commits for a specific path
Given
I visit my project's commits page for a specific path
Then
I see breadcrumb links
Scenario
:
I
browse commits stats
Given
I visit my project's commits stats page
Then
I see commits stats
features/steps/project/project_browse_commits.rb
View file @
06286352
...
...
@@ -51,4 +51,10 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
find
(
'ul.breadcrumb li:first a'
)[
'href'
].
should
match
(
/
#{
@project
.
path
}
\/commits\/master\z/
)
find
(
'ul.breadcrumb li:last a'
)[
'href'
].
should
match
(
%r{master/app/models/project
\.
rb
\z
}
)
end
Then
'I see commits stats'
do
page
.
should
have_content
'Stats for master'
page
.
should
have_content
'Committers'
page
.
should
have_content
'Total commits'
end
end
features/steps/shared/paths.rb
View file @
06286352
...
...
@@ -125,6 +125,10 @@ module SharedPaths
visit
project_commits_path
(
@project
,
@project
.
root_ref
+
"/app/models/project.rb"
,
{
limit:
5
})
end
Given
'I visit my project\'s commits stats page'
do
visit
stats_project_repository_path
(
@project
)
end
Given
"I visit my project's network page"
do
# Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650)
Gitlab
::
Graph
::
JsonBuilder
.
stub
(
max_count:
10
)
...
...
lib/gitlab/git_stats.rb
View file @
06286352
...
...
@@ -29,7 +29,7 @@ def graph
protected
def
collect_authors
shortlog
=
repo
.
git
.
shortlog
({
:
e
=>
true
,
:
s
=>
true
},
ref
)
shortlog
=
repo
.
git
.
shortlog
({
e
:
true
,
s
:
true
},
ref
)
authors
=
[]
...
...
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