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
Jérome Perrin
gitlab-ce
Commits
3e046733
Commit
3e046733
authored
Nov 10, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added feature test for stats
parent
1c5b2a51
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
3 deletions
+17
-3
app/views/repositories/stats.html.haml
app/views/repositories/stats.html.haml
+2
-2
features/project/commits/commits.feature
features/project/commits/commits.feature
+4
-0
features/steps/project/project_browse_commits.rb
features/steps/project/project_browse_commits.rb
+6
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+4
-0
lib/gitlab/git_stats.rb
lib/gitlab/git_stats.rb
+1
-1
No files found.
app/views/repositories/stats.html.haml
View file @
3e046733
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
%br
%br
%div
#activity-chart
%div
#activity-chart
.span7
.span7
%h4
Top
10
0 Committers:
%h4
Top
5
0 Committers:
%ol
.styled
%ol
.styled
-
@stats
.
authors
[
0
...
10
0
].
each
do
|
author
|
-
@stats
.
authors
[
0
...
5
0
].
each
do
|
author
|
%li
%li
=
image_tag
gravatar_icon
(
author
.
email
,
16
),
class:
'avatar s16'
=
image_tag
gravatar_icon
(
author
.
email
,
16
),
class:
'avatar s16'
=
author
.
name
=
author
.
name
...
...
features/project/commits/commits.feature
View file @
3e046733
...
@@ -23,3 +23,7 @@ Feature: Project Browse commits
...
@@ -23,3 +23,7 @@ Feature: Project Browse commits
Scenario
:
I
browse commits for a specific path
Scenario
:
I
browse commits for a specific path
Given
I visit my project's commits page for a specific path
Given
I visit my project's commits page for a specific path
Then
I see breadcrumb links
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 @
3e046733
...
@@ -51,4 +51,10 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
...
@@ -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: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
}
)
find
(
'ul.breadcrumb li:last a'
)[
'href'
].
should
match
(
%r{master/app/models/project
\.
rb
\z
}
)
end
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
end
features/steps/shared/paths.rb
View file @
3e046733
...
@@ -125,6 +125,10 @@ module SharedPaths
...
@@ -125,6 +125,10 @@ module SharedPaths
visit
project_commits_path
(
@project
,
@project
.
root_ref
+
"/app/models/project.rb"
,
{
limit:
5
})
visit
project_commits_path
(
@project
,
@project
.
root_ref
+
"/app/models/project.rb"
,
{
limit:
5
})
end
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
Given
"I visit my project's network page"
do
# Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650)
# Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650)
Gitlab
::
Graph
::
JsonBuilder
.
stub
(
max_count:
10
)
Gitlab
::
Graph
::
JsonBuilder
.
stub
(
max_count:
10
)
...
...
lib/gitlab/git_stats.rb
View file @
3e046733
...
@@ -29,7 +29,7 @@ module Gitlab
...
@@ -29,7 +29,7 @@ module Gitlab
protected
protected
def
collect_authors
def
collect_authors
shortlog
=
repo
.
git
.
shortlog
({
:e
=>
true
,
:s
=>
true
},
ref
)
shortlog
=
repo
.
git
.
shortlog
({
e:
true
,
s:
true
},
ref
)
authors
=
[]
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