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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
fcdeed86
Commit
fcdeed86
authored
Oct 15, 2019
by
Chieh-Min Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dummy project data for push sample data
Signed-off-by:
Chieh-Min Wang
<
chiehminw@synology.com
>
parent
21d17592
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
lib/gitlab/data_builder/push.rb
lib/gitlab/data_builder/push.rb
+28
-2
spec/lib/gitlab/data_builder/push_spec.rb
spec/lib/gitlab/data_builder/push_spec.rb
+26
-0
No files found.
lib/gitlab/data_builder/push.rb
View file @
fcdeed86
...
@@ -19,12 +19,25 @@ module Gitlab
...
@@ -19,12 +19,25 @@ module Gitlab
user_email:
"john@example.com"
,
user_email:
"john@example.com"
,
user_avatar:
"https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80"
,
user_avatar:
"https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80"
,
project_id:
15
,
project_id:
15
,
project:
{
id:
15
,
name:
"gitlab"
,
description:
""
,
web_url:
"http://test.example.com/gitlab/gitlab"
,
avatar_url:
"https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80"
,
git_ssh_url:
"git@test.example.com:gitlab/gitlab.git"
,
git_http_url:
"http://test.example.com/gitlab/gitlab.git"
,
namespace:
"gitlab"
,
visibility_level:
0
,
path_with_namespace:
"gitlab/gitlab"
,
default_branch:
"master"
},
commits:
[
commits:
[
{
{
id:
"c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
id:
"c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
message:
"Add simple search to projects in public area"
,
message:
"Add simple search to projects in public area"
,
timestamp:
"2013-05-13T18:18:08+00:00"
,
timestamp:
"2013-05-13T18:18:08+00:00"
,
url:
"https://test.example.com/gitlab/gitlab
hq
/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
url:
"https://test.example.com/gitlab/gitlab/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
author:
{
author:
{
name:
"Test User"
,
name:
"Test User"
,
email:
"test@example.com"
email:
"test@example.com"
...
@@ -45,7 +58,20 @@ module Gitlab
...
@@ -45,7 +58,20 @@ module Gitlab
# user_name: String,
# user_name: String,
# user_username: String,
# user_username: String,
# user_email: String
# user_email: String
# project_id: String,
# project_id: Fixnum,
# project: {
# id: Fixnum,
# name: String,
# description: String,
# web_url: String,
# avatar_url: String,
# git_ssh_url: String,
# git_http_url: String,
# namespace: String,
# visibility_level: Fixnum,
# path_with_namespace: String,
# default_branch: String
# }
# repository: {
# repository: {
# name: String,
# name: String,
# url: String,
# url: String,
...
...
spec/lib/gitlab/data_builder/push_spec.rb
View file @
fcdeed86
...
@@ -57,6 +57,32 @@ describe Gitlab::DataBuilder::Push do
...
@@ -57,6 +57,32 @@ describe Gitlab::DataBuilder::Push do
include_examples
'deprecated repository hook data'
include_examples
'deprecated repository hook data'
end
end
describe
'.sample_data'
do
let
(
:data
)
{
described_class
.
sample_data
}
it
{
expect
(
data
).
to
be_a
(
Hash
)
}
it
{
expect
(
data
[
:before
]).
to
eq
(
'95790bf891e76fee5e1747ab589903a6a1f80f22'
)
}
it
{
expect
(
data
[
:after
]).
to
eq
(
'da1560886d4f094c3e6c9ef40349f7d38b5d27d7'
)
}
it
{
expect
(
data
[
:ref
]).
to
eq
(
'refs/heads/master'
)
}
it
{
expect
(
data
[
:project_id
]).
to
eq
(
15
)
}
it
{
expect
(
data
[
:commits
].
size
).
to
eq
(
1
)
}
it
{
expect
(
data
[
:total_commits_count
]).
to
eq
(
1
)
}
it
'contains project data'
do
expect
(
data
[
:project
]).
to
be_a
(
Hash
)
expect
(
data
[
:project
][
:id
]).
to
eq
(
15
)
expect
(
data
[
:project
][
:name
]).
to
eq
(
'gitlab'
)
expect
(
data
[
:project
][
:description
]).
to
eq
(
''
)
expect
(
data
[
:project
][
:web_url
]).
to
eq
(
'http://test.example.com/gitlab/gitlab'
)
expect
(
data
[
:project
][
:avatar_url
]).
to
eq
(
'https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80'
)
expect
(
data
[
:project
][
:git_http_url
]).
to
eq
(
'http://test.example.com/gitlab/gitlab.git'
)
expect
(
data
[
:project
][
:git_ssh_url
]).
to
eq
(
'git@test.example.com:gitlab/gitlab.git'
)
expect
(
data
[
:project
][
:namespace
]).
to
eq
(
'gitlab'
)
expect
(
data
[
:project
][
:visibility_level
]).
to
eq
(
0
)
expect
(
data
[
:project
][
:path_with_namespace
]).
to
eq
(
'gitlab/gitlab'
)
expect
(
data
[
:project
][
:default_branch
]).
to
eq
(
'master'
)
end
end
describe
'.build'
do
describe
'.build'
do
let
(
:data
)
do
let
(
:data
)
do
described_class
.
build
(
described_class
.
build
(
...
...
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