Commit df5459d1 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'add-project-field-for-push-sample-data' into 'master'

add dummy project data for push sample data

See merge request gitlab-org/gitlab!18571
parents a0ac2ea3 fcdeed86
......@@ -19,12 +19,25 @@ module Gitlab
user_email: "john@example.com",
user_avatar: "https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80",
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: [
{
id: "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
message: "Add simple search to projects in public area",
timestamp: "2013-05-13T18:18:08+00:00",
url: "https://test.example.com/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
url: "https://test.example.com/gitlab/gitlab/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
author: {
name: "Test User",
email: "test@example.com"
......@@ -45,7 +58,20 @@ module Gitlab
# user_name: String,
# user_username: 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: {
# name: String,
# url: String,
......
......@@ -57,6 +57,32 @@ describe Gitlab::DataBuilder::Push do
include_examples 'deprecated repository hook data'
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
let(:data) do
described_class.build(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment