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
iv
gitlab-ce
Commits
9da1928f
Commit
9da1928f
authored
Sep 29, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use phantomjs for jasmine tests. Fixed broken one
parent
9f8d50e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
35 deletions
+32
-35
spec/javascripts/stat_graph_contributors_util_spec.js
spec/javascripts/stat_graph_contributors_util_spec.js
+29
-24
spec/javascripts/support/jasmine_helper.rb
spec/javascripts/support/jasmine_helper.rb
+3
-11
No files found.
spec/javascripts/stat_graph_contributors_util_spec.js
View file @
9da1928f
...
...
@@ -3,10 +3,10 @@ describe("ContributorsStatGraphUtil", function () {
describe
(
"
#parse_log
"
,
function
()
{
it
(
"
returns a correctly parsed log
"
,
function
()
{
var
fake_log
=
[
{
author
:
"
Karlo Soriano
"
,
date
:
"
2013-05-09
"
,
additions
:
471
},
{
author
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
6
,
deletions
:
1
},
{
author
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
19
,
deletions
:
3
},
{
author
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
29
,
deletions
:
3
}]
{
author
_email
:
"
karlo@email.com
"
,
author_name
:
"
Karlo Soriano
"
,
date
:
"
2013-05-09
"
,
additions
:
471
},
{
author
_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
6
,
deletions
:
1
},
{
author
_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
19
,
deletions
:
3
},
{
author
_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
29
,
deletions
:
3
}]
var
correct_parsed_log
=
{
total
:
[
...
...
@@ -15,11 +15,11 @@ describe("ContributorsStatGraphUtil", function () {
by_author
:
[
{
author
:
"
Karlo Soriano
"
,
author
_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
"
2013-05-09
"
:
{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
}
},
{
author
:
"
Dmitriy Zaporozhets
"
,
author
_name
:
"
Dmitriy Zaporozhets
"
,
author_email
:
"
dzaporozhets@email.com
"
,
"
2013-05-08
"
:
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}
}
]
...
...
@@ -112,10 +112,10 @@ describe("ContributorsStatGraphUtil", function () {
describe
(
"
#add_author
"
,
function
()
{
it
(
"
adds an author field to the collection
"
,
function
()
{
var
fake_author
=
"
Author
"
var
fake_author
=
{
author_name
:
"
Author
"
,
author_email
:
'
fake@email.com
'
}
var
fake_collection
=
{}
ContributorsStatGraphUtil
.
add_author
(
fake_author
,
fake_collection
)
expect
(
fake_collection
[
fake_author
].
author
).
toEqual
(
"
Author
"
)
expect
(
fake_collection
[
fake_author
.
author_name
].
author_name
).
toEqual
(
"
Author
"
)
})
})
...
...
@@ -153,30 +153,35 @@ describe("ContributorsStatGraphUtil", function () {
describe
(
"
#get_author_data
"
,
function
()
{
it
(
"
returns the log by author sorted by specified field
"
,
function
()
{
var
fake_parsed_log
=
{
total
:
[{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
},
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}],
by_author
:[
{
author
:
"
Karlo Soriano
"
,
"
2013-05-09
"
:
{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
}
},
{
author
:
"
Dmitriy Zaporozhets
"
,
"
2013-05-08
"
:
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}
total
:
[
{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
},
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}
],
by_author
:
[
{
author_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
"
2013-05-09
"
:
{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
}
},
{
author_name
:
"
Dmitriy Zaporozhets
"
,
author_email
:
"
dzaporozhets@email.com
"
,
"
2013-05-08
"
:
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}
}
]
}
]}
var
correct_author_data
=
[{
author
:
"
Dmitriy Zaporozhets
"
,
dates
:{
"
2013-05-08
"
:
3
},
deletions
:
7
,
additions
:
54
,
"
commits
"
:
3
},
{
author
:
"
Karlo Soriano
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}]
var
correct_author_data
=
[
{
author_name
:
"
Dmitriy Zaporozhets
"
,
author_email
:
"
dzaporozhets@email.com
"
,
dates
:{
"
2013-05-08
"
:
3
},
deletions
:
7
,
additions
:
54
,
"
commits
"
:
3
},
{
author_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}
]
expect
(
ContributorsStatGraphUtil
.
get_author_data
(
fake_parsed_log
,
"
commits
"
)).
toEqual
(
correct_author_data
)
})
})
describe
(
"
#parse_log_entry
"
,
function
()
{
it
(
"
adds the corresponding info from the log entry to the author
"
,
function
()
{
var
fake_log_entry
=
{
author
:
"
Karlo Soriano
"
,
var
fake_log_entry
=
{
author
_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
"
2013-05-09
"
:
{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
}
}
var
correct_parsed_log
=
{
author
:
"
Karlo Soriano
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}
var
correct_parsed_log
=
{
author
_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}
expect
(
ContributorsStatGraphUtil
.
parse_log_entry
(
fake_log_entry
,
'
commits
'
,
null
)).
toEqual
(
correct_parsed_log
)
})
})
...
...
@@ -197,4 +202,4 @@ describe("ContributorsStatGraphUtil", function () {
})
})
\ No newline at end of file
})
spec/javascripts/support/jasmine_helper.rb
View file @
9da1928f
#Use this file to set/override Jasmine configuration options
#You can remove it if you don't need it.
#This file is loaded *after* jasmine.yml is interpreted.
#
#Example: using a different boot file.
#Jasmine.configure do |config|
# @config.boot_dir = '/absolute/path/to/boot_dir'
# @config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] }
#end
#
Jasmine
.
configure
do
|
config
|
config
.
browser
=
:phantomjs
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