Codebase list ruby-gitlab / ec6860b
New upstream version 4.5.0 Cédric Boutillier 5 years ago
226 changed file(s) with 9400 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 .git
1 Gemfile.lock
2 Dockerfile
3 docker-compose.yml
4 *.gem
5 deploy
0 Layout/SpaceAroundEqualsInParameterDefault:
1 Enabled: false
2
3 Style/Alias:
4 Enabled: false
5
6 Style/PercentLiteralDelimiters:
7 Enabled: false
8
9 Layout/DotPosition:
10 Enabled: false
11
12 Metrics/LineLength:
13 Max: 100
14 Exclude:
15 - 'lib/gitlab/client/*'
16 - 'spec/**/*'
17
18 Style/ClassAndModuleChildren:
19 Exclude:
20 - 'lib/gitlab/client/*'
21
22 Layout/SpaceInsideHashLiteralBraces:
23 Exclude:
24 - 'lib/gitlab/client/*'
25
26 Style/StringLiterals:
27 Exclude:
28 - 'spec/**/*'
29
30 Metrics/BlockLength:
31 Exclude:
32 - 'spec/**/*'
0 language: ruby
1 rvm:
2 - 2.3
3 - 2.4
4 - 2.5
5 before_install: gem update bundler
6
7 matrix:
8 include:
9 - rvm: 2.4
10 env: "TRAVIS_CI_RUBOCOP=true"
11 allow_failures:
12 - env: "TRAVIS_CI_RUBOCOP=true"
0 FROM ruby:2.5
1
2 WORKDIR /app
3
4 COPY . ./
5 RUN bundle install
6
7 CMD ["bin/console"]
0 # For more information, see https://docs.gitlab.com/omnibus/docker/README.html#install-gitlab-using-docker-compose
1 version: '3'
2 services:
3 app:
4 build: .
5 volumes:
6 - ./:/app
7 env_file: docker.env
8
9 gitlab:
10 image: 'gitlab/gitlab-ce:latest'
11 restart: always
12 hostname: 'gitlab.example.com'
13 environment:
14 GITLAB_OMNIBUS_CONFIG: |
15 external_url 'http://gitlab.example.com:3000'
16 # Add any other gitlab.rb configuration here, each on its own line
17 ports:
18 - 3000:3000
0 GITLAB_API_ENDPOINT=http://gitlab:3000/api/v4
1 GITLAB_API_PRIVATE_TOKEN=j3CLYZMg_dsTPpCR2HWf
0 {
1 "id": 1,
2 "username": "raymond_smith",
3 "name": "Raymond Smith",
4 "state": "active",
5 "created_at": "2012-10-22T14:13:35Z",
6 "requested_at": "2012-10-22T14:13:35Z"
7 }
0 [
1 {
2 "id": 1,
3 "username": "raymond_smith",
4 "name": "Raymond Smith",
5 "state": "active",
6 "created_at": "2012-10-22T14:13:35Z",
7 "requested_at": "2012-10-22T14:13:35Z"
8 },
9 {
10 "id": 2,
11 "username": "john_doe",
12 "name": "John Doe",
13 "state": "active",
14 "created_at": "2012-10-22T14:13:35Z",
15 "requested_at": "2012-10-22T14:13:35Z"
16 }
17 ]
0 {
1 "id": 1,
2 "username": "raymond_smith",
3 "name": "Raymond Smith",
4 "state": "active",
5 "created_at": "2012-10-22T14:13:35Z",
6 "access_level": 20
7 }
0 { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1 }
0 [ { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1 }, { "id" : 2, "label" : { "name" : "Ready", "color" : "#FF0000", "description" : null }, "position" : 2 }, { "id" : 3, "label" : { "name" : "Production", "color" : "#FF5F00", "description" : null }, "position" : 3 } ]
0 [ { "id" : 1, "lists" : [ { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1 }, { "id" : 2, "label" : { "name" : "Ready", "color" : "#FF0000", "description" : null }, "position" : 2 }, { "id" : 3, "label" : { "name" : "Production", "color" : "#FF5F00", "description" : null }, "position" : 3 } ] } ]
0 {"name":"api","commit":{"id":"f7dd067490fe57505f7226c3b54d3127d2f7fd46","parents":[{"id":"949b1df930bedace1dbd755aaa4a82e8c451a616"}],"tree":"f8c4b21c036339f92fcc5482aa28a41250553b27","message":"API: expose issues project id","author":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"committer":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"authored_date":"2012-07-25T04:22:21-07:00","committed_date":"2012-07-25T04:22:21-07:00"},"protected": true}
0 {
1 "branch_name": "api"
2 }
0 [{"name":"api","commit":{"id":"f7dd067490fe57505f7226c3b54d3127d2f7fd46","parents":[{"id":"949b1df930bedace1dbd755aaa4a82e8c451a616"}],"tree":"f8c4b21c036339f92fcc5482aa28a41250553b27","message":"API: expose issues project id","author":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"committer":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"authored_date":"2012-07-25T04:22:21-07:00","committed_date":"2012-07-25T04:22:21-07:00"}},{"name":"dashboard-feed","commit":{"id":"f8f6ff065eccc6ede4d35ed87a09bb962b84ca25","parents":[{"id":"2cf8010792c3075824ee27d0f037aeb178cbbf7e"}],"tree":"e17f2157143d550891d4669c10b7446e4739bc6d","message":"add projects atom feed","author":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"committer":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"authored_date":"2012-05-31T23:42:02-07:00","committed_date":"2012-05-31T23:42:02-07:00"}},{"name":"master","commit":{"id":"2cf8010792c3075824ee27d0f037aeb178cbbf7e","parents":[{"id":"af226ae9c9af406c8a0e0bbdf364563495c2f432"},{"id":"e851cb07762aa464aae10e8b4b28de87c1a6f925"}],"tree":"6c6845838039f01723d91f395a1d2fa1dcc82522","message":"Merge pull request #868 from SaitoWu/bugfix/encoding\n\nBugfix/encoding","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-05-30T00:24:43-07:00","committed_date":"2012-05-30T00:24:43-07:00"}},{"name":"preview_notes","commit":{"id":"3749e0d99ac6bfbc65889b1b7a5310e14e7fe89a","parents":[{"id":"2483181f2c3d4ea7d2c68147b19bc07fc3937b0c"}],"tree":"f8c56161b0d6561568f088df9961362eb1ece88b","message":"pass project_id to notes preview path","author":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"committer":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"authored_date":"2012-08-09T23:46:27-07:00","committed_date":"2012-08-09T23:46:27-07:00"}},{"name":"refactoring","commit":{"id":"7c7761099cae83f59fe5780340e100be890847b2","parents":[{"id":"058d80b3363dd4fc4417ca4f60f76119188a2470"}],"tree":"d7d4a94c700dc0e84ee943019213d2358a49c413","message":"fix deprecation warnings","author":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"committer":{"name":"Nihad Abbasov","email":"narkoz.2008@gmail.com"},"authored_date":"2012-05-29T07:16:28-07:00","committed_date":"2012-05-29T07:16:28-07:00"}}]
0 {
1 "commit": {
2 "author_email": "admin@example.com",
3 "author_name": "Administrator",
4 "created_at": "2015-12-24T16:51:14.000+01:00",
5 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
6 "message": "Test the CI integration.",
7 "short_id": "0ff3ae19",
8 "title": "Test the CI integration."
9 },
10 "coverage": null,
11 "created_at": "2015-12-24T15:51:21.880Z",
12 "download_url": null,
13 "finished_at": "2015-12-24T17:54:31.198Z",
14 "id": 8,
15 "name": "rubocop",
16 "ref": "master",
17 "runner": null,
18 "stage": "test",
19 "started_at": "2015-12-24T17:54:30.733Z",
20 "status": "failed",
21 "tag": false,
22 "user": {
23 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
24 "bio": null,
25 "created_at": "2015-12-21T13:14:24.077Z",
26 "id": 1,
27 "is_admin": true,
28 "linkedin": "",
29 "name": "John Smith",
30 "skype": "",
31 "state": "active",
32 "twitter": "",
33 "username": "root",
34 "web_url": "http://gitlab.dev/u/root",
35 "website_url": ""
36 }
37 }
0 {
1 "commit": {
2 "author_email": "admin@example.com",
3 "author_name": "John Smith",
4 "created_at": "2015-12-24T16:51:14.000+01:00",
5 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
6 "message": "Test the CI integration.",
7 "short_id": "0ff3ae19",
8 "title": "Test the CI integration."
9 },
10 "coverage": null,
11 "created_at": "2016-01-11T10:13:33.506Z",
12 "download_url": null,
13 "finished_at": "2016-01-11T10:14:09.526Z",
14 "id": 69,
15 "name": "rubocop",
16 "ref": "master",
17 "runner": null,
18 "stage": "test",
19 "started_at": null,
20 "status": "canceled",
21 "tag": false,
22 "user": null
23 }
0 {
1 "commit": {
2 "author_email": "admin@example.com",
3 "author_name": "John Smith",
4 "created_at": "2015-12-24T16:51:14.000+01:00",
5 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
6 "message": "Test the CI integration.",
7 "short_id": "0ff3ae19",
8 "title": "Test the CI integration."
9 },
10 "coverage": null,
11 "download_url": null,
12 "id": 69,
13 "name": "rubocop",
14 "ref": "master",
15 "runner": null,
16 "stage": "test",
17 "created_at": "2016-01-11T10:13:33.506Z",
18 "started_at": "2016-01-11T10:13:33.506Z",
19 "finished_at": "2016-01-11T10:15:10.506Z",
20 "status": "failed",
21 "tag": false,
22 "user": null
23 }
0 {
1 "commit": {
2 "author_email": "admin@example.com",
3 "author_name": "John Smith",
4 "created_at": "2015-12-24T16:51:14.000+01:00",
5 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
6 "message": "Test the CI integration.",
7 "short_id": "0ff3ae19",
8 "title": "Test the CI integration."
9 },
10 "coverage": null,
11 "created_at": "2016-01-11T10:13:33.506Z",
12 "download_url": null,
13 "finished_at": null,
14 "id": 69,
15 "name": "rubocop",
16 "ref": "master",
17 "runner": null,
18 "stage": "test",
19 "started_at": null,
20 "status": "pending",
21 "tag": false,
22 "user": null
23 }
0 [
1 {
2 "commit": {
3 "author_email": "admin@example.com",
4 "author_name": "Administrator",
5 "created_at": "2015-12-24T16:51:14.000+01:00",
6 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
7 "message": "Test the CI integration.",
8 "short_id": "0ff3ae19",
9 "title": "Test the CI integration."
10 },
11 "coverage": null,
12 "created_at": "2015-12-24T15:51:21.802Z",
13 "download_url": null,
14 "finished_at": "2015-12-24T17:54:27.895Z",
15 "id": 7,
16 "name": "teaspoon",
17 "ref": "master",
18 "runner": null,
19 "stage": "test",
20 "started_at": "2015-12-24T17:54:27.722Z",
21 "status": "failed",
22 "tag": false,
23 "user": {
24 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
25 "bio": null,
26 "created_at": "2015-12-21T13:14:24.077Z",
27 "id": 1,
28 "is_admin": true,
29 "linkedin": "",
30 "name": "Administrator",
31 "skype": "",
32 "state": "active",
33 "twitter": "",
34 "username": "root",
35 "web_url": "http://gitlab.dev/u/root",
36 "website_url": ""
37 }
38 },
39 {
40 "commit": {
41 "author_email": "admin@example.com",
42 "author_name": "Administrator",
43 "created_at": "2015-12-24T16:51:14.000+01:00",
44 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
45 "message": "Test the CI integration.",
46 "short_id": "0ff3ae19",
47 "title": "Test the CI integration."
48 },
49 "coverage": null,
50 "created_at": "2015-12-24T15:51:21.727Z",
51 "download_url": null,
52 "finished_at": "2015-12-24T17:54:24.921Z",
53 "id": 6,
54 "name": "spinach:other",
55 "ref": "master",
56 "runner": null,
57 "stage": "test",
58 "started_at": "2015-12-24T17:54:24.729Z",
59 "status": "failed",
60 "tag": false,
61 "user": {
62 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
63 "bio": null,
64 "created_at": "2015-12-21T13:14:24.077Z",
65 "id": 1,
66 "is_admin": true,
67 "linkedin": "",
68 "name": "Administrator",
69 "skype": "",
70 "state": "active",
71 "twitter": "",
72 "username": "root",
73 "web_url": "http://gitlab.dev/u/root",
74 "website_url": ""
75 }
76 }
77 ]
0 [
1 {
2 "commit": {
3 "author_email": "admin@example.com",
4 "author_name": "Administrator",
5 "created_at": "2015-12-24T16:51:14.000+01:00",
6 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
7 "message": "Test the CI integration.",
8 "short_id": "0ff3ae19",
9 "title": "Test the CI integration."
10 },
11 "coverage": null,
12 "created_at": "2016-01-11T10:13:33.506Z",
13 "download_url": null,
14 "finished_at": "2016-01-11T10:14:09.526Z",
15 "id": 69,
16 "name": "rubocop",
17 "ref": "master",
18 "runner": null,
19 "stage": "test",
20 "started_at": null,
21 "status": "canceled",
22 "tag": false,
23 "user": null
24 },
25 {
26 "commit": {
27 "author_email": "admin@example.com",
28 "author_name": "Administrator",
29 "created_at": "2015-12-24T16:51:14.000+01:00",
30 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
31 "message": "Test the CI integration.",
32 "short_id": "0ff3ae19",
33 "title": "Test the CI integration."
34 },
35 "coverage": null,
36 "created_at": "2015-12-24T15:51:21.957Z",
37 "download_url": null,
38 "finished_at": "2015-12-24T17:54:33.913Z",
39 "id": 9,
40 "name": "brakeman",
41 "ref": "master",
42 "runner": null,
43 "stage": "test",
44 "started_at": "2015-12-24T17:54:33.727Z",
45 "status": "failed",
46 "tag": false,
47 "user": {
48 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
49 "bio": null,
50 "created_at": "2015-12-21T13:14:24.077Z",
51 "id": 1,
52 "is_admin": true,
53 "linkedin": "",
54 "name": "Administrator",
55 "skype": "",
56 "state": "active",
57 "twitter": "",
58 "username": "root",
59 "web_url": "http://gitlab.dev/u/root",
60 "website_url": ""
61 }
62 }
63 ]
0
1 {
2 "commit": {
3 "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1",
4 "short_id": "12d65c8dd2b",
5 "title": "JS fix",
6 "author_name": "Dmitriy Zaporozhets",
7 "author_email": "dmitriy.zaporozhets@gmail.com",
8 "created_at": "2014-02-27T10:27:00+02:00"
9 },
10 "commits": [{
11 "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1",
12 "short_id": "12d65c8dd2b",
13 "title": "JS fix",
14 "author_name": "Dmitriy Zaporozhets",
15 "author_email": "dmitriy.zaporozhets@gmail.com",
16 "created_at": "2014-02-27T10:27:00+02:00"
17 }],
18 "diffs": [{
19 "old_path": "files/js/application.js",
20 "new_path": "files/js/application.js",
21 "a_mode": null,
22 "b_mode": "100644",
23 "diff": "--- a/files/js/application.js\n+++ b/files/js/application.js\n@@ -24,8 +24,10 @@\n //= require g.raphael-min\n //= require g.bar-min\n //= require branch-graph\n-//= require highlightjs.min\n-//= require ace/ace\n //= require_tree .\n //= require d3\n //= require underscore\n+\n+function fix() { \n+ alert(\"Fixed\")\n+}",
24 "new_file": false,
25 "renamed_file": false,
26 "deleted_file": false
27 }],
28 "compare_timeout": false,
29 "compare_same_ref": false
30 }
0 {
1 "id": 1,
2 "username": "raymond_smith",
3 "name": "Raymond Smith",
4 "state": "active",
5 "created_at": "2012-10-22T14:13:35Z",
6 "access_level": 30
7 }
0 {
1 "id": 42,
2 "iid": 2,
3 "ref": "master",
4 "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
5 "created_at": "2016-08-11T11:32:35.444Z",
6 "user": {
7 "name": "Administrator",
8 "username": "root",
9 "id": 1,
10 "state": "active",
11 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
12 "web_url": "http://localhost:3000/root"
13 },
14 "environment": {
15 "id": 9,
16 "name": "production",
17 "external_url": "https://about.gitlab.com"
18 },
19 "deployable": {
20 "id": 664,
21 "status": "success",
22 "stage": "deploy",
23 "name": "deploy",
24 "ref": "master",
25 "tag": false,
26 "coverage": null,
27 "created_at": "2016-08-11T11:32:24.456Z",
28 "started_at": null,
29 "finished_at": "2016-08-11T11:32:35.145Z",
30 "user": {
31 "name": "Administrator",
32 "username": "root",
33 "id": 1,
34 "state": "active",
35 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
36 "web_url": "http://localhost:3000/root",
37 "created_at": "2016-08-11T07:09:20.351Z",
38 "bio": null,
39 "location": null,
40 "skype": "",
41 "linkedin": "",
42 "twitter": "",
43 "website_url": ""
44 },
45 "commit": {
46 "id": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
47 "short_id": "a91957a8",
48 "title": "Merge branch 'rename-readme' into 'master'\r",
49 "author_name": "Administrator",
50 "author_email": "admin@example.com",
51 "created_at": "2016-08-11T13:28:26.000+02:00",
52 "message": "Merge branch 'rename-readme' into 'master'\r\n\r\nRename README\r\n\r\n\r\n\r\nSee merge request !2"
53 },
54 "runner": null
55 }
56 }
0 [
1 {
2 "created_at": "2016-08-11T07:36:40.222Z",
3 "deployable": {
4 "commit": {
5 "author_email": "admin@example.com",
6 "author_name": "Administrator",
7 "created_at": "2016-08-11T09:36:01.000+02:00",
8 "id": "99d03678b90d914dbb1b109132516d71a4a03ea8",
9 "message": "Merge branch 'new-title' into 'master'\r\n\r\nUpdate README\r\n\r\n\r\n\r\nSee merge request !1",
10 "short_id": "99d03678",
11 "title": "Merge branch 'new-title' into 'master'\r"
12 },
13 "coverage": null,
14 "created_at": "2016-08-11T07:36:27.357Z",
15 "finished_at": "2016-08-11T07:36:39.851Z",
16 "id": 657,
17 "name": "deploy",
18 "ref": "master",
19 "runner": null,
20 "stage": "deploy",
21 "started_at": null,
22 "status": "success",
23 "tag": false,
24 "user": {
25 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
26 "bio": null,
27 "created_at": "2016-08-11T07:09:20.351Z",
28 "id": 1,
29 "linkedin": "",
30 "location": null,
31 "name": "Administrator",
32 "skype": "",
33 "state": "active",
34 "twitter": "",
35 "username": "root",
36 "web_url": "http://localhost:3000/root",
37 "website_url": ""
38 }
39 },
40 "environment": {
41 "external_url": "https://about.gitlab.com",
42 "id": 9,
43 "name": "production"
44 },
45 "id": 41,
46 "iid": 1,
47 "ref": "master",
48 "sha": "99d03678b90d914dbb1b109132516d71a4a03ea8",
49 "user": {
50 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
51 "id": 1,
52 "name": "Administrator",
53 "state": "active",
54 "username": "root",
55 "web_url": "http://localhost:3000/root"
56 }
57 },
58 {
59 "created_at": "2016-08-11T11:32:35.444Z",
60 "deployable": {
61 "commit": {
62 "author_email": "admin@example.com",
63 "author_name": "Administrator",
64 "created_at": "2016-08-11T13:28:26.000+02:00",
65 "id": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
66 "message": "Merge branch 'rename-readme' into 'master'\r\n\r\nRename README\r\n\r\n\r\n\r\nSee merge request !2",
67 "short_id": "a91957a8",
68 "title": "Merge branch 'rename-readme' into 'master'\r"
69 },
70 "coverage": null,
71 "created_at": "2016-08-11T11:32:24.456Z",
72 "finished_at": "2016-08-11T11:32:35.145Z",
73 "id": 664,
74 "name": "deploy",
75 "ref": "master",
76 "runner": null,
77 "stage": "deploy",
78 "started_at": null,
79 "status": "success",
80 "tag": false,
81 "user": {
82 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
83 "bio": null,
84 "created_at": "2016-08-11T07:09:20.351Z",
85 "id": 1,
86 "linkedin": "",
87 "location": null,
88 "name": "Administrator",
89 "skype": "",
90 "state": "active",
91 "twitter": "",
92 "username": "root",
93 "web_url": "http://localhost:3000/root",
94 "website_url": ""
95 }
96 },
97 "environment": {
98 "external_url": "https://about.gitlab.com",
99 "id": 9,
100 "name": "production"
101 },
102 "id": 42,
103 "iid": 2,
104 "ref": "master",
105 "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
106 "user": {
107 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
108 "id": 1,
109 "name": "Administrator",
110 "state": "active",
111 "username": "root",
112 "web_url": "http://localhost:3000/root"
113 }
114 }
115 ]
(New empty file)
0 {
1 "id": 12,
2 "name": "staging",
3 "slug": "staging-cb247rv",
4 "external_url": "https://staging.example.gitlab.com"
5 }
0 [
1 {
2 "id": 1,
3 "name": "review/fix-foo",
4 "slug": "review-fix-foo-dfjre3",
5 "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com"
6 },
7 {
8 "id": 12,
9 "name": "review/fix-bar",
10 "slug": "review-fix-bar-dbwr18",
11 "external_url": "https://review-fix-bar-dbwr18.example.gitlab.com"
12 }
13 ]
0 {"message": "409 Already exists"}
0 {"message": "404 Project Not Found"}
0 {"file_name":"README.md", "file_path":"README.md", "size":"19", "encoding":"base64", "content":"VGhpcyBpcyBhICpSRUFETUUqIQ==\n", "ref":"master", "blob_id":"0eba9dff767611060181e0423a1de2941d27efc8", "commit_id":"eb38397cb6ae669219e6bc18ad19981fff18ea29"}
0 {"id": 10, "name": "GitLab-Group", "path": "gitlab-group", "owner_id": 6, "projects": [
1 {
2 "id": 9,
3 "name": "mojito",
4 "description": null,
5 "default_branch": "master",
6 "owner": {
7 "id": 6,
8 "username": "jose",
9 "email": "jose@abc.com",
10 "name": "Jose Jose",
11 "blocked": false,
12 "created_at": "2013-02-06T06:54:06Z"
13 },
14 "path": "mojito",
15 "path_with_namespace": "gitlab-group/mojito",
16 "issues_enabled": true,
17 "merge_requests_enabled": true,
18 "wall_enabled": true,
19 "wiki_enabled": true,
20 "created_at": "2013-02-06T16:59:15Z",
21 "namespace": {
22 "created_at": "2013-02-06T16:58:22Z",
23 "id": 10,
24 "name": "GitLab-Group",
25 "owner_id": 6,
26 "path": "gitlab-group",
27 "updated_at": "2013-02-06T16:58:22Z"
28 }
29 },
30 {
31 "id": 10,
32 "name": "gitlabhq",
33 "description": null,
34 "default_branch": null,
35 "owner": {
36 "id": 6,
37 "username": "randx",
38 "email": "randx@github.com",
39 "name": "Dmitry Z",
40 "blocked": false,
41 "created_at": "2013-02-06T06:54:06Z"
42 },
43 "path": "gitlabhq",
44 "path_with_namespace": "gitlab-group/gitlabhq",
45 "issues_enabled": true,
46 "merge_requests_enabled": true,
47 "wall_enabled": true,
48 "wiki_enabled": true,
49 "created_at": "2013-02-06T17:02:31Z",
50 "namespace": {
51 "created_at": "2013-02-06T16:58:22Z",
52 "id": 10,
53 "name": "GitLab-Group",
54 "owner_id": 6,
55 "path": "gitlab-group",
56 "updated_at": "2013-02-06T16:58:22Z"
57 }
58 }
59 ]}
0 {"id":3,"name":"Gitlab-Group","path":"gitlab-group","owner_id":1}
0 {"id":3,"name":"Gitlab-Group","path":"gitlab-group","owner_id":1,"description":"gitlab group description"}
0 {"id":42,"name":"Gitlab-Group","path":"gitlab-group","created_at":"2016-02-24T20:16:42.906Z","updated_at":"2016-02-24T20:16:42.906Z"}
0 {
1 "id": 1,
2 "name": "Foobar Group",
3 "path": "foo-bar",
4 "description": "An interesting group",
5 "visibility": "public",
6 "lfs_enabled": true,
7 "avatar_url": "http://gitlab.example.com/uploads/group/avatar/1/foo.jpg",
8 "web_url": "http://gitlab.example.com/groups/foo-bar",
9 "request_access_enabled": false,
10 "full_name": "Foobar Group",
11 "full_path": "foo-bar",
12 "parent_id": 123
13 }
0 {"id":2,"username":"jsmith","email":"jsmith@local.host","name":"John Smith","state":"active","created_at":"2013-09-04T18:15:30Z","access_level":10}
0 {"created_at":"2013-09-04T18:18:15Z","group_access":10,"group_id":3,"id":2,"notification_level":3,"updated_at":"2013-09-04T18:18:15Z","user_id":2}
0 {"id":2,"username":"jsmith","email":"jsmith@local.host","name":"John Smith","state":"active","created_at":"2013-09-04T18:15:30Z","access_level":50}
0 [{"id":1,"username":"eraymond","email":"eraymond@local.host","name":"Edward Raymond","state":"active","created_at":"2013-08-30T16:16:22Z","access_level":50},{"id":1,"username":"jsmith","email":"jsmith@local.host","name":"John Smith","state":"active","created_at":"2013-08-30T16:16:22Z","access_level":50}]
0 {"id":1,"group_id":3,"title":"3.0","description":"","due_date":"2012-10-22","closed":false,"updated_at":"2012-09-17T10:15:31Z","created_at":"2012-09-17T10:15:31Z"}
0 [{"id":1,"project_id":3,"title":"Culpa eius recusandae suscipit autem distinctio dolorum.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":6,"project_id":3,"title":"Ut in dolorum omnis sed sit aliquam.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":12,"project_id":3,"title":"Veniam et tempore quidem eum reprehenderit cupiditate non aut velit eaque.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":21,"project_id":3,"title":"Vitae ea aliquam et quo eligendi sapiente voluptatum labore hic nihil culpa.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":26,"project_id":3,"title":"Quo enim est nihil atque placeat voluptas neque eos voluptas.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":32,"project_id":3,"title":"Deserunt tenetur impedit est beatae voluptas voluptas quaerat quisquam.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"}]
0 [{"id":1,"iid":1,"project_id":1,"title":"lorem ipsum","description":"","state":"opened","created_at":"2017-03-24T12:23:53.918Z","updated_at":"2017-03-24T12:23:53.918Z","target_branch":"master","source_branch":"def","upvotes":0,"downvotes":0,"author":{"name":"John Doe","username":"jdoe","id":1,"state":"active","avatar_url":"","web_url":"https://gitlab.com/jdoen"},"assignee":null,"source_project_id":1,"target_project_id":1,"labels":[],"work_in_progress":false,"milestone":{"id":1,"iid":1,"project_id":1,"title":"Test","description":"","state":"active","created_at":"2017-03-24T12:23:00.560Z","updated_at":"2017-03-24T12:23:00.560Z","due_date":null,"start_date":null},"merge_when_pipeline_succeeds":false,"merge_status":"can_be_merged","sha":"aec123d1775790b2347fdd684b5ba613fdeb994b","merge_commit_sha":null,"user_notes_count":0,"approvals_before_merge":null,"should_remove_source_branch":null,"force_remove_source_branch":false,"squash":false,"web_url":"https://gitlab.com/jdoe/milestone_merge_requests_test/merge_requests/2"},{"id":2,"iid":2,"project_id":1,"title":"ipsum lorem","description":"","state":"opened","created_at":"2017-03-24T12:23:24.662Z","updated_at":"2017-03-24T12:23:33.522Z","target_branch":"master","source_branch":"test1","upvotes":0,"downvotes":0,"author":{"name":"Joren","username":"jdoe","id":1,"state":"active","":"","web_url":"https://gitlab.com/jdoe"},"assignee":null,"source_project_id":1,"target_project_id":1,"labels":[],"work_in_progress":false,"milestone":{"id":1,"iid":1,"project_id":1,"title":"Test","description":"","state":"active","created_at":"2017-03-24T12:23:00.560Z","updated_at":"2017-03-24T12:23:00.560Z","due_date":null,"start_date":null},"merge_when_pipeline_succeeds":false,"merge_status":"can_be_merged","sha":"3ee44c9b40deddae596f838b97523c6f010fd80d","merge_commit_sha":null,"user_notes_count":0,"approvals_before_merge":null,"should_remove_source_branch":null,"force_remove_source_branch":true,"squash":false,"web_url":"https://gitlab.com/jdoe/milestone_merge_requests_test/merge_requests/1"}]
0 [{"id":1,"group_id":3,"title":"3.0","description":"","due_date":"2012-10-22","closed":false,"updated_at":"2012-09-17T10:15:31Z","created_at":"2012-09-17T10:15:31Z"}]
0 [
1 {
2 "id": 4,
3 "description": null,
4 "default_branch": "master",
5 "public": false,
6 "visibility_level": 0,
7 "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
8 "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
9 "web_url": "http://example.com/diaspora/diaspora-client",
10 "tag_list": [
11 "example",
12 "disapora client"
13 ],
14 "owner": {
15 "id": 3,
16 "name": "Diaspora",
17 "created_at": "2013-09-30T13: 46: 02Z"
18 },
19 "name": "Diaspora Client",
20 "name_with_namespace": "Diaspora / Diaspora Client",
21 "path": "diaspora-client",
22 "path_with_namespace": "diaspora/diaspora-client",
23 "issues_enabled": true,
24 "merge_requests_enabled": true,
25 "builds_enabled": true,
26 "wiki_enabled": true,
27 "snippets_enabled": false,
28 "created_at": "2013-09-30T13: 46: 02Z",
29 "last_activity_at": "2013-09-30T13: 46: 02Z",
30 "creator_id": 3,
31 "namespace": {
32 "created_at": "2013-09-30T13: 46: 02Z",
33 "description": "",
34 "id": 3,
35 "name": "Diaspora",
36 "owner_id": 1,
37 "path": "diaspora",
38 "updated_at": "2013-09-30T13: 46: 02Z"
39 },
40 "archived": false,
41 "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png"
42 }
43 ]
0 [{"id": 5,"name": "Five-Group","path": "five-group","owner_id": 2},{"id": 8,"name": "Eight Group","path": "eight-group","owner_id": 6}
1 ]
0 [
1 {
2 "id": 1,
3 "name": "Foobar Group",
4 "path": "foo-bar",
5 "description": "An interesting group",
6 "visibility": "public",
7 "lfs_enabled": true,
8 "avatar_url": "http://gitlab.example.com/uploads/group/avatar/1/foo.jpg",
9 "web_url": "http://gitlab.example.com/groups/foo-bar",
10 "request_access_enabled": false,
11 "full_name": "Foobar Group",
12 "full_path": "foo-bar",
13 "parent_id": 123
14 }
15 ]
0 [{"id": 3,"name": "ThreeGroup","path": "threegroup","owner_id": 1},{"id": 5,"name": "Five-Group","path": "five-group","owner_id": 2},{"id": 8,"name": "Eight Group","path": "eight-group","owner_id": 6}
1 ]
0 {"id":33,"project_id":3,"title":"Beatae possimus nostrum nihil reiciendis laboriosam nihil delectus alias accusantium dolor unde.","description":null,"labels":[],"milestone":null,"assignee":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"}
0 {
1 "id": 4,
2 "name": "blowfish",
3 "user": {
4 "name": "Administrator",
5 "username": "root",
6 "id": 1,
7 "state": "active",
8 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
9 "web_url": "http://gitlab.example.com/root"
10 },
11 "created_at": "2016-06-15T10:09:34.206Z",
12 "updated_at": "2016-06-15T10:09:34.206Z",
13 "awardable_id": 80,
14 "awardable_type": "Issue"
15 }
0 [
1 {
2 "id": 4,
3 "name": "1234",
4 "user": {
5 "name": "Administrator",
6 "username": "root",
7 "id": 1,
8 "state": "active",
9 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
10 "web_url": "http://gitlab.example.com/root"
11 },
12 "created_at": "2016-06-15T10:09:34.206Z",
13 "updated_at": "2016-06-15T10:09:34.206Z",
14 "awardable_id": 80,
15 "awardable_type": "Issue"
16 },
17 {
18 "id": 1,
19 "name": "microphone",
20 "user": {
21 "name": "User 4",
22 "username": "user4",
23 "id": 26,
24 "state": "active",
25 "avatar_url": "http://www.gravatar.com/avatar/7e65550957227bd38fe2d7fbc6fd2f7b?s=80&d=identicon",
26 "web_url": "http://gitlab.example.com/user4"
27 },
28 "created_at": "2016-06-15T10:09:34.177Z",
29 "updated_at": "2016-06-15T10:09:34.177Z",
30 "awardable_id": 80,
31 "awardable_type": "Issue"
32 }
33 ]
0 [{"id":1,"project_id":1,"title":"Culpa eius recusandae suscipit autem distinctio dolorum.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":6,"project_id":2,"title":"Ut in dolorum omnis sed sit aliquam.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":12,"project_id":3,"title":"Veniam et tempore quidem eum reprehenderit cupiditate non aut velit eaque.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":21,"project_id":1,"title":"Vitae ea aliquam et quo eligendi sapiente voluptatum labore hic nihil culpa.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":26,"project_id":2,"title":"Quo enim est nihil atque placeat voluptas neque eos voluptas.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":32,"project_id":3,"title":"Deserunt tenetur impedit est beatae voluptas voluptas quaerat quisquam.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"}]
0 {
1 "commit": {
2 "author_email": "admin@example.com",
3 "author_name": "Administrator",
4 "created_at": "2015-12-24T16:51:14.000+01:00",
5 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
6 "message": "Test the CI integration.",
7 "short_id": "0ff3ae19",
8 "title": "Test the CI integration."
9 },
10 "coverage": null,
11 "created_at": "2015-12-24T15:51:21.880Z",
12 "artifacts_file": null,
13 "finished_at": "2015-12-24T17:54:31.198Z",
14 "id": 8,
15 "name": "rubocop",
16 "pipeline": {
17 "id": 6,
18 "ref": "master",
19 "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
20 "status": "pending"
21 },
22 "ref": "master",
23 "runner": null,
24 "stage": "test",
25 "started_at": "2015-12-24T17:54:30.733Z",
26 "status": "failed",
27 "tag": false,
28 "user": {
29 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
30 "bio": null,
31 "created_at": "2015-12-21T13:14:24.077Z",
32 "id": 1,
33 "linkedin": "",
34 "name": "Administrator",
35 "skype": "",
36 "state": "active",
37 "twitter": "",
38 "username": "root",
39 "web_url": "http://gitlab.dev/root",
40 "website_url": ""
41 }
42 }
0 [
1 {
2 "commit": {
3 "author_email": "admin@example.com",
4 "author_name": "Administrator",
5 "created_at": "2015-12-24T16:51:14.000+01:00",
6 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
7 "message": "Test the CI integration.",
8 "short_id": "0ff3ae19",
9 "title": "Test the CI integration."
10 },
11 "coverage": null,
12 "created_at": "2015-12-24T15:51:21.802Z",
13 "artifacts_file": {
14 "filename": "artifacts.zip",
15 "size": 1000
16 },
17 "finished_at": "2015-12-24T17:54:27.895Z",
18 "id": 7,
19 "name": "teaspoon",
20 "pipeline": {
21 "id": 6,
22 "ref": "master",
23 "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
24 "status": "pending"
25 },
26 "ref": "master",
27 "runner": null,
28 "stage": "test",
29 "started_at": "2015-12-24T17:54:27.722Z",
30 "status": "failed",
31 "tag": false,
32 "user": {
33 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
34 "bio": null,
35 "created_at": "2015-12-21T13:14:24.077Z",
36 "id": 1,
37 "linkedin": "",
38 "name": "Administrator",
39 "skype": "",
40 "state": "active",
41 "twitter": "",
42 "username": "root",
43 "web_url": "http://gitlab.dev/root",
44 "website_url": ""
45 }
46 },
47 {
48 "commit": {
49 "author_email": "admin@example.com",
50 "author_name": "Administrator",
51 "created_at": "2015-12-24T16:51:14.000+01:00",
52 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
53 "message": "Test the CI integration.",
54 "short_id": "0ff3ae19",
55 "title": "Test the CI integration."
56 },
57 "coverage": null,
58 "created_at": "2015-12-24T15:51:21.727Z",
59 "artifacts_file": null,
60 "finished_at": "2015-12-24T17:54:24.921Z",
61 "id": 6,
62 "name": "spinach:other",
63 "pipeline": {
64 "id": 6,
65 "ref": "master",
66 "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
67 "status": "pending"
68 },
69 "ref": "master",
70 "runner": null,
71 "stage": "test",
72 "started_at": "2015-12-24T17:54:24.729Z",
73 "status": "failed",
74 "tag": false,
75 "user": {
76 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
77 "bio": null,
78 "created_at": "2015-12-21T13:14:24.077Z",
79 "id": 1,
80 "linkedin": "",
81 "name": "Administrator",
82 "skype": "",
83 "state": "active",
84 "twitter": "",
85 "username": "root",
86 "web_url": "http://gitlab.dev/root",
87 "website_url": ""
88 }
89 }
90 ]
0 {"id":1,"title":"narkoz@helium","key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkUsh42Nh1yefGd1jbSELn5XsY8p5Oxmau0/1HqHnjuYOaj5X+kHccFDwtmtg9Ox8ua/+WptNsiE8IUwsD3zKgEjajgwq3gMeeFdxfXwM+tEvHOOMV9meRrgRWGYCToPbT6sR7/YMAYa7cPqWSpx/oZhYfz4XtoMv3ZZT1fZMmx3MY3HwXwW8j+obJyN2K4LN0TFi9RPgWWYn0DCyb9OccmABimt3i74WoJ/OT8r6/7swce8+OSe0Q2wBhyTtvxg2vtUcoek8Af+EZaUMBwSEzEsocOCzwQvjF5XUk5o7dJ8nP8W3RE60JWX57t16eQm7lBmumLYfszpn2isd6W7a1 narkoz@helium"}
0 [{"id":1,"title":"narkoz@helium","key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkUsh42Nh1yefGd1jbSELn5XsY8p5Oxmau0/1HqHnjuYOaj5X+kHccFDwtmtg9Ox8ua/+WptNsiE8IUwsD3zKgEjajgwq3gMeeFdxfXwM+tEvHOOMV9meRrgRWGYCToPbT6sR7/YMAYa7cPqWSpx/oZhYfz4XtoMv3ZZT1fZMmx3MY3HwXwW8j+obJyN2K4LN0TFi9RPgWWYn0DCyb9OccmABimt3i74WoJ/OT8r6/7swce8+OSe0Q2wBhyTtvxg2vtUcoek8Af+EZaUMBwSEzEsocOCzwQvjF5XUk5o7dJ8nP8W3RE60JWX57t16eQm7lBmumLYfszpn2isd6W7a1 narkoz@helium"}]
0 {"name": "Backlog", "color": "#DD10AA", "subscribed": true}
0 {"name": "Backlog", "color": "#DD10AA", "subscribed": false}
0 [{"name": "Backlog", "color": "#DD10AA"},{"name": "Documentation", "color": "#1E80DD"}]
0 {"id":1,"target_branch":"master","source_branch":"api","project_id":3,"title":"New feature","closed":false,"merged":false,"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-10-19T05:56:05Z"},"assignee":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-10-19T05:56:14Z"}}
0 {
1 "id": 5,
2 "iid": 5,
3 "project_id": 1,
4 "title": "Approvals API",
5 "description": "Test",
6 "state": "opened",
7 "created_at": "2016-06-08T00:19:52.638Z",
8 "updated_at": "2016-06-08T21:20:42.470Z",
9 "merge_status": "can_be_merged",
10 "approvals_required": 2,
11 "approvals_missing": 2,
12 "approved_by": [],
13 "approvers": [
14 {
15 "user": {
16 "name": "Administrator",
17 "username": "root",
18 "id": 1,
19 "state": "active",
20 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
21 "web_url": "http://localhost:3000/u/root"
22 }
23 }
24 ],
25 "approver_groups": [
26 {
27 "group": {
28 "id": 5,
29 "name": "group1",
30 "path": "group1",
31 "description": "",
32 "visibility": "public",
33 "lfs_enabled": false,
34 "avatar_url": null,
35 "web_url": "http://localhost/groups/group1",
36 "request_access_enabled": false,
37 "full_name": "group1",
38 "full_path": "group1",
39 "parent_id": null,
40 "ldap_cn": null,
41 "ldap_access": null
42 }
43 }
44 ]
45 }
0 {
1 "id": 4,
2 "name": "blowfish",
3 "user": {
4 "name": "Administrator",
5 "username": "root",
6 "id": 1,
7 "state": "active",
8 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
9 "web_url": "http://gitlab.example.com/root"
10 },
11 "created_at": "2016-06-15T10:09:34.206Z",
12 "updated_at": "2016-06-15T10:09:34.206Z",
13 "awardable_id": 80,
14 "awardable_type": "MergeRequest"
15 }
0 [
1 {
2 "id": 4,
3 "name": "1234",
4 "user": {
5 "name": "Administrator",
6 "username": "root",
7 "id": 1,
8 "state": "active",
9 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
10 "web_url": "http://gitlab.example.com/root"
11 },
12 "created_at": "2016-06-15T10:09:34.206Z",
13 "updated_at": "2016-06-15T10:09:34.206Z",
14 "awardable_id": 80,
15 "awardable_type": "MergeRequest"
16 },
17 {
18 "id": 1,
19 "name": "microphone",
20 "user": {
21 "name": "User 4",
22 "username": "user4",
23 "id": 26,
24 "state": "active",
25 "avatar_url": "http://www.gravatar.com/avatar/7e65550957227bd38fe2d7fbc6fd2f7b?s=80&d=identicon",
26 "web_url": "http://gitlab.example.com/user4"
27 },
28 "created_at": "2016-06-15T10:09:34.177Z",
29 "updated_at": "2016-06-15T10:09:34.177Z",
30 "awardable_id": 80,
31 "awardable_type": "MergeRequest"
32 }
33 ]
0 {"id":2,"iid":5,"project_id":3,"title":"Uncovered","description":"","state":"opened","created_at":"2015-03-15T23:15:13.292+01:00","updated_at":"2015-03-15T23:15:14.132+01:00","target_branch":"master","source_branch":"uncovered","upvotes":0,"downvotes":0,"author":{"name":"Dominik Sander","username":"dsander","id":1,"state":"active","avatar_url":"https://secure.gravatar.com/avatar/7f01734389dd6730d076ddee04838bd3?s=40\u0026d=identicon"},"assignee":null,"source_project_id":6,"target_project_id":6,"labels":[],"milestone":null,"changes":[{"old_path":"lib/omniauth/builder.rb","new_path":"lib/omniauth/builder.rb","a_mode":"100644","b_mode":"100644","diff":"--- a/lib/omniauth/builder.rb\n+++ b/lib/omniauth/builder.rb\n@@ -7,11 +7,13 @@ module OmniAuth\n else\n @app = app\n super(\u0026block)\n+ two = 1 # woah! uncovered\n @ins \u003c\u003c @app\n end\n end\n \n def rack14?\n+ one = 2 # thats oke!\n Rack.release.split('.')[1].to_i \u003e= 4\n end\n ","new_file":false,"renamed_file":false,"deleted_file":false}]}
0 [{"id":1,"iid":1,"project_id":5,"title":"Merge request 1 issue 1","description":"","state":"opened","created_at":"2017-04-06T08:03:36.163Z","updated_at":"2017-04-06T08:03:57.087Z","labels":[],"milestone":null,"assignee":null,"author":{"name":"John","username":"jdoe","id":1,"state":"active","avatar_url":"","web_url":"https://gitlab.com/jdoe"},"user_notes_count":0,"upvotes":0,"downvotes":0,"due_date":null,"confidential":false,"weight":null,"web_url":"https://gitlab.com/jdoe/milestone_merge_requests_test/issues/1"},{"id":2,"iid":2,"project_id":5,"title":"Merge request 1 issue 2","description":"","state":"opened","created_at":"2017-04-06T08:03:44.023Z","updated_at":"2017-04-06T08:03:44.023Z","labels":[],"milestone":null,"assignee":null,"author":{"name":"John","username":"jdoe","id":426047,"state":"active","avatar_url":"","web_url":"https://gitlab.com/jdoe"},"user_notes_count":0,"upvotes":0,"downvotes":0,"due_date":null,"confidential":false,"weight":null,"web_url":"https://gitlab.com/jdoe/milestone_merge_requests_test/issues/2"}]
0 {"note":"Cool Merge Request!","author":{"id":1,"username":"jsmith","email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-07-11T01:32:18Z"}}
0 [{"note":"this is the 1st comment on the 2merge merge request","author":{"id":11,"username":"admin","email":"admin@example.com","name":"A User","state":"active","created_at":"2014-03-06T08:17:35.000Z"}},{"note":"another discussion point on the 2merge request","author":{"id":12,"username":"admin","email":"admin@example.com","name":"A User","state":"active","created_at":"2014-03-06T08:17:35.000Z"}}]
0 [{"id":"a2da7552f26d5b46a6a09bb8b7b066e3a102be7d","short_id":"a2da7552","title": "piyo","author_name":"example","author_email":"example@example.com","created_at":"2015-12-19T18:02:31.000+09:00","message":"fuga"},{"id":"3ce509590f37dbce5b877c3e1c78bd3903493170","short_id":"3ce50959","title":"hoge","author_name":"example","author_email":"example@example.com","created_at":"2015-12-19T17:53:46.000+09:00","message":"Hoge"}]
0 {
1 "id": "7d66bf19bf835e6a4666130544ba1b5c343fc705",
2 "individual_note": false,
3 "notes": [
4 {
5 "id": 1758,
6 "type": "DiffNote",
7 "body": "test test",
8 "attachment": null,
9 "author": {
10 "id": 1,
11 "name": "Dominik Sander",
12 "username": "dsander",
13 "state": "active",
14 "avatar_url": "https://secure.gravatar.com/avatar/7f017343sf43896ddee04838bd3?s=80&d=identicon",
15 "web_url": "https://example.com/dsander"
16 },
17 "created_at": "2018-05-22T22:00:18.858+02:00",
18 "updated_at": "2018-05-22T22:00:18.858+02:00",
19 "system": false,
20 "noteable_id": 208,
21 "noteable_type": "MergeRequest",
22 "position": {
23 "base_sha": "fb60b1f9e3005a4ec8e039c4ec16b6d36f8e75c9",
24 "start_sha": "3c14868ce2ffbf3294ff8c0de828fd1a0e545aae",
25 "head_sha": "7d938cb8ac15788d71f4b67c035515a160ea76d8",
26 "old_path": "spec/omniauth/form_spec.rb",
27 "new_path": "spec/omniauth/form_spec.rb",
28 "position_type": "text",
29 "old_line": 5,
30 "new_line": null
31 },
32 "resolvable": true,
33 "resolved": false,
34 "resolved_by": null,
35 "noteable_iid": 13
36 }
37 ]
38 }
0 {
1 "id": 1775,
2 "type": "DiffNote",
3 "body": "much note",
4 "attachment": null,
5 "author": {
6 "id": 1,
7 "name": "Dominik Sander",
8 "username": "dsander",
9 "state": "active",
10 "avatar_url": "https://secure.gravatar.com/avatar/7f017343sf43896ddee04838bd3?s=80&d=identicon",
11 "web_url": "https://example.com/dsander"
12 },
13 "created_at": "2018-05-23T22:21:46.993+02:00",
14 "updated_at": "2018-05-23T22:21:46.993+02:00",
15 "system": false,
16 "noteable_id": 208,
17 "noteable_type": "MergeRequest",
18 "position": {
19 "base_sha": "fb60b1f9e3005a4ec8e039c4ec16b6d36f8e75c9",
20 "start_sha": "3c14868ce2ffbf3294ff8c0de828fd1a0e545aae",
21 "head_sha": "7d938cb8ac15788d71f4b67c035515a160ea76d8",
22 "old_path": "spec/omniauth/form_spec.rb",
23 "new_path": "spec/omniauth/form_spec.rb",
24 "position_type": "text",
25 "old_line": 9,
26 "new_line": null
27 },
28 "resolvable": true,
29 "resolved": false,
30 "resolved_by": null,
31 "noteable_iid": 13
32 }
0 [
1 {
2 "id": "7d66bf19bf835e6a4666130544ba1b5c343fc705",
3 "individual_note": false,
4 "notes": [
5 {
6 "id": 1758,
7 "type": "DiffNote",
8 "body": "test test",
9 "attachment": null,
10 "author": {
11 "id": 1,
12 "name": "Dominik Sander",
13 "username": "dsander",
14 "state": "active",
15 "avatar_url": "https://secure.gravatar.com/avatar/7f017343sf43896ddee04838bd3?s=80&d=identicon",
16 "web_url": "https://example.com/dsander"
17 },
18 "created_at": "2018-05-22T22:00:18.858+02:00",
19 "updated_at": "2018-05-22T22:00:18.858+02:00",
20 "system": false,
21 "noteable_id": 208,
22 "noteable_type": "MergeRequest",
23 "position": {
24 "base_sha": "fb60b1f9e3005a4ec8e039c4ec16b6d36f8e75c9",
25 "start_sha": "3c14868ce2ffbf3294ff8c0de828fd1a0e545aae",
26 "head_sha": "7d938cb8ac15788d71f4b67c035515a160ea76d8",
27 "old_path": "spec/omniauth/form_spec.rb",
28 "new_path": "spec/omniauth/form_spec.rb",
29 "position_type": "text",
30 "old_line": 5,
31 "new_line": null
32 },
33 "resolvable": true,
34 "resolved": false,
35 "resolved_by": null,
36 "noteable_iid": 13
37 }
38 ]
39 }
40 ]
0 [{"id":1,"target_branch":"master","source_branch":"api","project_id":3,"title":"New feature","closed":false,"merged":false,"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-10-19T05:56:05Z"},"assignee":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-10-19T05:56:14Z"}}]
0 {"id":1,"project_id":3,"title":"3.0","description":"","due_date":"2012-10-22","closed":false,"updated_at":"2012-09-17T10:15:31Z","created_at":"2012-09-17T10:15:31Z"}
0 [{"id":1,"project_id":3,"title":"Culpa eius recusandae suscipit autem distinctio dolorum.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":6,"project_id":3,"title":"Ut in dolorum omnis sed sit aliquam.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":12,"project_id":3,"title":"Veniam et tempore quidem eum reprehenderit cupiditate non aut velit eaque.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":21,"project_id":3,"title":"Vitae ea aliquam et quo eligendi sapiente voluptatum labore hic nihil culpa.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":26,"project_id":3,"title":"Quo enim est nihil atque placeat voluptas neque eos voluptas.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":32,"project_id":3,"title":"Deserunt tenetur impedit est beatae voluptas voluptas quaerat quisquam.","description":null,"labels":[],"milestone":{"id": 1},"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"}]
0 [{"id":1,"iid":1,"project_id":1,"title":"lorem ipsum","description":"","state":"opened","created_at":"2017-03-24T12:23:53.918Z","updated_at":"2017-03-24T12:23:53.918Z","target_branch":"master","source_branch":"def","upvotes":0,"downvotes":0,"author":{"name":"John Doe","username":"jdoe","id":1,"state":"active","avatar_url":"","web_url":"https://gitlab.com/jdoen"},"assignee":null,"source_project_id":1,"target_project_id":1,"labels":[],"work_in_progress":false,"milestone":{"id":1,"iid":1,"project_id":1,"title":"Test","description":"","state":"active","created_at":"2017-03-24T12:23:00.560Z","updated_at":"2017-03-24T12:23:00.560Z","due_date":null,"start_date":null},"merge_when_pipeline_succeeds":false,"merge_status":"can_be_merged","sha":"aec123d1775790b2347fdd684b5ba613fdeb994b","merge_commit_sha":null,"user_notes_count":0,"approvals_before_merge":null,"should_remove_source_branch":null,"force_remove_source_branch":false,"squash":false,"web_url":"https://gitlab.com/jdoe/milestone_merge_requests_test/merge_requests/2"},{"id":2,"iid":2,"project_id":1,"title":"ipsum lorem","description":"","state":"opened","created_at":"2017-03-24T12:23:24.662Z","updated_at":"2017-03-24T12:23:33.522Z","target_branch":"master","source_branch":"test1","upvotes":0,"downvotes":0,"author":{"name":"Joren","username":"jdoe","id":1,"state":"active","":"","web_url":"https://gitlab.com/jdoe"},"assignee":null,"source_project_id":1,"target_project_id":1,"labels":[],"work_in_progress":false,"milestone":{"id":1,"iid":1,"project_id":1,"title":"Test","description":"","state":"active","created_at":"2017-03-24T12:23:00.560Z","updated_at":"2017-03-24T12:23:00.560Z","due_date":null,"start_date":null},"merge_when_pipeline_succeeds":false,"merge_status":"can_be_merged","sha":"3ee44c9b40deddae596f838b97523c6f010fd80d","merge_commit_sha":null,"user_notes_count":0,"approvals_before_merge":null,"should_remove_source_branch":null,"force_remove_source_branch":true,"squash":false,"web_url":"https://gitlab.com/jdoe/milestone_merge_requests_test/merge_requests/1"}]
0 [{"id":1,"project_id":3,"title":"3.0","description":"","due_date":"2012-10-22","closed":false,"updated_at":"2012-09-17T10:15:31Z","created_at":"2012-09-17T10:15:31Z"}]
0 [{"id": 1, "path": "john", "kind": "user"}]
0 {"id":1201,"body":"The solution is rather tricky","author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"created_at":"2012-11-27T19:16:44Z"}
0 {
1 "id": 4,
2 "name": "mood_bubble_lightning",
3 "user": {
4 "name": "User 4",
5 "username": "user4",
6 "id": 26,
7 "state": "active",
8 "avatar_url": "http://www.gravatar.com/avatar/7e65550957227bd38fe2d7fbc6fd2f7b?s=80&d=identicon",
9 "web_url": "http://gitlab.example.com/user4"
10 },
11 "created_at": "2016-06-15T10:09:34.197Z",
12 "updated_at": "2016-06-15T10:09:34.197Z",
13 "awardable_id": 1,
14 "awardable_type": "Note"
15 }
0 [
1 {
2 "id": 2,
3 "name": "mood_bubble_lightning",
4 "user": {
5 "name": "User 4",
6 "username": "user4",
7 "id": 26,
8 "state": "active",
9 "avatar_url": "http://www.gravatar.com/avatar/7e65550957227bd38fe2d7fbc6fd2f7b?s=80&d=identicon",
10 "web_url": "http://gitlab.example.com/user4"
11 },
12 "created_at": "2016-06-15T10:09:34.197Z",
13 "updated_at": "2016-06-15T10:09:34.197Z",
14 "awardable_id": 1,
15 "awardable_type": "Note"
16 }
17 ]
0 [{"id":1201,"body":"The solution is rather tricky","author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"created_at":"2012-11-27T19:16:44Z"},{"id":1207,"body":"I know, right?","author":{"id":1,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"created_at":"2012-11-27T19:58:21Z"}]
0 {
1 "id": 46,
2 "status": "success",
3 "ref": "master",
4 "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
5 "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
6 "tag": false,
7 "yaml_errors": null,
8 "user": {
9 "name": "Administrator",
10 "username": "root",
11 "id": 1,
12 "state": "active",
13 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
14 "web_url": "http://localhost:3000/root"
15 },
16 "created_at": "2016-08-11T11:28:34.085Z",
17 "updated_at": "2016-08-11T11:32:35.169Z",
18 "started_at": null,
19 "finished_at": "2016-08-11T11:32:35.145Z",
20 "committed_at": null,
21 "duration": null
22 }
0 {
1 "id": 46,
2 "status": "canceled",
3 "ref": "master",
4 "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
5 "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
6 "tag": false,
7 "yaml_errors": null,
8 "user": {
9 "name": "Administrator",
10 "username": "root",
11 "id": 1,
12 "state": "active",
13 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
14 "web_url": "http://localhost:3000/root"
15 },
16 "created_at": "2016-08-11T11:28:34.085Z",
17 "updated_at": "2016-08-11T11:32:35.169Z",
18 "started_at": null,
19 "finished_at": "2016-08-11T11:32:35.145Z",
20 "committed_at": null,
21 "duration": null
22 }
0 {
1 "id": 61,
2 "sha": "384c444e840a515b23f21915ee5766b87068a70d",
3 "ref": "master",
4 "status": "pending",
5 "before_sha": "0000000000000000000000000000000000000000",
6 "tag": false,
7 "yaml_errors": null,
8 "user": {
9 "name": "Administrator",
10 "username": "root",
11 "id": 1,
12 "state": "active",
13 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
14 "web_url": "http://localhost:3000/root"
15 },
16 "created_at": "2016-11-04T09:36:13.747Z",
17 "updated_at": "2016-11-04T09:36:13.977Z",
18 "started_at": null,
19 "finished_at": null,
20 "committed_at": null,
21 "duration": null
22 }
0 [
1 {
2 "commit": {
3 "author_email": "admin@example.com",
4 "author_name": "Administrator",
5 "created_at": "2015-12-24T16:51:14.000+01:00",
6 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
7 "message": "Test the CI integration.",
8 "short_id": "0ff3ae19",
9 "title": "Test the CI integration."
10 },
11 "coverage": null,
12 "created_at": "2015-12-24T15:51:21.802Z",
13 "artifacts_file": {
14 "filename": "artifacts.zip",
15 "size": 1000
16 },
17 "finished_at": "2015-12-24T17:54:27.895Z",
18 "id": 7,
19 "name": "teaspoon",
20 "pipeline": {
21 "id": 6,
22 "ref": "master",
23 "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
24 "status": "pending"
25 },
26 "ref": "master",
27 "runner": null,
28 "stage": "test",
29 "started_at": "2015-12-24T17:54:27.722Z",
30 "status": "failed",
31 "tag": false,
32 "user": {
33 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
34 "bio": null,
35 "created_at": "2015-12-21T13:14:24.077Z",
36 "id": 1,
37 "linkedin": "",
38 "name": "Administrator",
39 "skype": "",
40 "state": "active",
41 "twitter": "",
42 "username": "root",
43 "web_url": "http://gitlab.dev/root",
44 "website_url": ""
45 }
46 },
47 {
48 "commit": {
49 "author_email": "admin@example.com",
50 "author_name": "Administrator",
51 "created_at": "2015-12-24T16:51:14.000+01:00",
52 "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
53 "message": "Test the CI integration.",
54 "short_id": "0ff3ae19",
55 "title": "Test the CI integration."
56 },
57 "coverage": null,
58 "created_at": "2015-12-24T15:51:21.727Z",
59 "artifacts_file": null,
60 "finished_at": "2015-12-24T17:54:24.921Z",
61 "id": 6,
62 "name": "spinach:other",
63 "pipeline": {
64 "id": 6,
65 "ref": "master",
66 "sha": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd",
67 "status": "pending"
68 },
69 "ref": "master",
70 "runner": null,
71 "stage": "test",
72 "started_at": "2015-12-24T17:54:24.729Z",
73 "status": "failed",
74 "tag": false,
75 "user": {
76 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
77 "bio": null,
78 "created_at": "2015-12-21T13:14:24.077Z",
79 "id": 1,
80 "linkedin": "",
81 "name": "Administrator",
82 "skype": "",
83 "state": "active",
84 "twitter": "",
85 "username": "root",
86 "web_url": "http://gitlab.dev/root",
87 "website_url": ""
88 }
89 }
90 ]
0 {
1 "id": 46,
2 "status": "pending",
3 "ref": "master",
4 "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
5 "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
6 "tag": false,
7 "yaml_errors": null,
8 "user": {
9 "name": "Administrator",
10 "username": "root",
11 "id": 1,
12 "state": "active",
13 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
14 "web_url": "http://localhost:3000/root"
15 },
16 "created_at": "2016-08-11T11:28:34.085Z",
17 "updated_at": "2016-08-11T11:32:35.169Z",
18 "started_at": null,
19 "finished_at": "2016-08-11T11:32:35.145Z",
20 "committed_at": null,
21 "duration": null
22 }
0 {
1 "id": 13,
2 "description": "Test schedule pipeline",
3 "ref": "master",
4 "cron": "* * * * *",
5 "cron_timezone": "Asia/Tokyo",
6 "next_run_at": "2017-05-19T13:41:00.000Z",
7 "active": true,
8 "created_at": "2017-05-19T13:31:08.849Z",
9 "updated_at": "2017-05-19T13:40:17.727Z",
10 "last_pipeline": {
11 "id": 332,
12 "sha": "0e788619d0b5ec17388dffb973ecd505946156db",
13 "ref": "master",
14 "status": "pending"
15 },
16 "owner": {
17 "name": "Administrator",
18 "username": "root",
19 "id": 1,
20 "state": "active",
21 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
22 "web_url": "https://gitlab.example.com/root"
23 },
24 "variables": [
25 {
26 "key": "TEST_VARIABLE_1",
27 "value": "TEST_1"
28 }
29 ]
30 }
31
0 {
1 "id": 14,
2 "description": "Build packages",
3 "ref": "master",
4 "cron": "0 1 * * 5",
5 "cron_timezone": "UTC",
6 "next_run_at": "2017-05-26T01:00:00.000Z",
7 "active": true,
8 "created_at": "2017-05-19T13:43:08.169Z",
9 "updated_at": "2017-05-19T13:43:08.169Z",
10 "last_pipeline": null,
11 "owner": {
12 "name": "Administrator",
13 "username": "root",
14 "id": 1,
15 "state": "active",
16 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
17 "web_url": "https://gitlab.example.com/root"
18 }
19 }
20
0 {
1 "id": 13,
2 "description": "Test schedule pipeline",
3 "ref": "master",
4 "cron": "0 2 * * *",
5 "cron_timezone": "Asia/Tokyo",
6 "next_run_at": "2017-05-19T17:00:00.000Z",
7 "active": true,
8 "created_at": "2017-05-19T13:31:08.849Z",
9 "updated_at": "2017-05-19T13:44:16.135Z",
10 "last_pipeline": {
11 "id": 332,
12 "sha": "0e788619d0b5ec17388dffb973ecd505946156db",
13 "ref": "master",
14 "status": "pending"
15 },
16 "owner": {
17 "name": "Administrator",
18 "username": "root",
19 "id": 1,
20 "state": "active",
21 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
22 "web_url": "https://gitlab.example.com/root"
23 }
24 }
25
0 {
1 "key": "NEW_VARIABLE",
2 "value": "new value"
3 }
4
0 {
1 "key": "NEW_VARIABLE",
2 "value": "update value"
3 }
4
0 [
1 {
2 "id": 13,
3 "description": "Test schedule pipeline",
4 "ref": "master",
5 "cron": "* * * * *",
6 "cron_timezone": "Asia/Tokyo",
7 "next_run_at": "2017-05-19T13:41:00.000Z",
8 "active": true,
9 "created_at": "2017-05-19T13:31:08.849Z",
10 "updated_at": "2017-05-19T13:40:17.727Z",
11 "owner": {
12 "name": "Administrator",
13 "username": "root",
14 "id": 1,
15 "state": "active",
16 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
17 "web_url": "https://gitlab.example.com/root"
18 }
19 }
20 ]
21
0 [
1 {
2 "id": 47,
3 "status": "pending",
4 "ref": "new-pipeline",
5 "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
6 "before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
7 "tag": false,
8 "yaml_errors": null,
9 "user": {
10 "name": "Administrator",
11 "username": "root",
12 "id": 1,
13 "state": "active",
14 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
15 "web_url": "http://localhost:3000/root"
16 },
17 "created_at": "2016-08-16T10:23:19.007Z",
18 "updated_at": "2016-08-16T10:23:19.216Z",
19 "started_at": null,
20 "finished_at": null,
21 "committed_at": null,
22 "duration": null
23 },
24 {
25 "id": 48,
26 "status": "pending",
27 "ref": "new-pipeline",
28 "sha": "eb94b618fb5865b26e80fdd8ae531b7a63ad851a",
29 "before_sha": "eb94b618fb5865b26e80fdd8ae531b7a63ad851a",
30 "tag": false,
31 "yaml_errors": null,
32 "user": {
33 "name": "Administrator",
34 "username": "root",
35 "id": 1,
36 "state": "active",
37 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
38 "web_url": "http://localhost:3000/root"
39 },
40 "created_at": "2016-08-16T10:23:21.184Z",
41 "updated_at": "2016-08-16T10:23:21.314Z",
42 "started_at": null,
43 "finished_at": null,
44 "committed_at": null,
45 "duration": null
46 }
47 ]
0 {"id":3,"code":"gitlab","name":"Gitlab","description":null,"path":"gitlab","default_branch":null,"owner":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"public":false,"issues_enabled":true,"merge_requests_enabled":true,"wall_enabled":true,"wiki_enabled":true,"created_at":"2012-09-17T09:41:58Z"}
0 {
1 "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
2 "short_id": "6104942438c",
3 "title": "Sanitize for network graph",
4 "author_name": "randx",
5 "author_email": "dmitriy.zaporozhets@gmail.com",
6 "created_at": "2012-09-20T09:06:12+03:00",
7 "committed_date": "2012-09-20T09:06:12+03:00",
8 "authored_date": "2012-09-20T09:06:12+03:00",
9 "parent_ids": [
10 "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
11 ]
12 }
0 {"note":"Nice code!","author":{"id":1,"username":"jsmith","email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-07-11T01:32:18Z"}}
0 [{"note":"this is the 1st comment on commit 6104942438c14ec7bd21c6cd5bd995272b3faff6","author":{"id":11,"username":"admin","email":"admin@example.com","name":"A User","state":"active","created_at":"2014-03-06T08:17:35.000Z"}},{"note":"another discussion point on commit 6104942438c14ec7bd21c6cd5bd995272b3faff6","author":{"id":12,"username":"admin","email":"admin@example.com","name":"A User","state":"active","created_at":"2014-03-06T08:17:35.000Z"}}]
0 {
1 "id": "ed899a2f4b50b4370feeea94676502b42383c746",
2 "short_id": "ed899a2f4b5",
3 "title": "some commit message",
4 "author_name": "Dmitriy Zaporozhets",
5 "author_email": "dzaporozhets@sphereconsultinginc.com",
6 "committer_name": "Dmitriy Zaporozhets",
7 "committer_email": "dzaporozhets@sphereconsultinginc.com",
8 "created_at": "2016-09-20T09:26:24.000-07:00",
9 "message": "some commit message",
10 "parent_ids": [
11 "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
12 ],
13 "committed_date": "2016-09-20T09:26:24.000-07:00",
14 "authored_date": "2016-09-20T09:26:24.000-07:00",
15 "stats": {
16 "additions": 2,
17 "deletions": 2,
18 "total": 4
19 },
20 "status": null
21 }
0 {
1 "diff": "--- a/doc/update/5.4-to-6.0.md\n+++ b/doc/update/5.4-to-6.0.md\n@@ -71,6 +71,8 @@\n sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production\n sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production\n \n+sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production\n+\n ```\n \n ### 6. Update config files",
2 "new_path": "doc/update/5.4-to-6.0.md",
3 "old_path": "doc/update/5.4-to-6.0.md",
4 "a_mode": null,
5 "b_mode": "100644",
6 "new_file": false,
7 "renamed_file": false,
8 "deleted_file": false
9 }
0 [{"id":1,"iid":1,"project_id":1,"title":"Title","description":"","state":"merged","created_at":"2018-05-15T18:38:47.192Z","updated_at":"2018-05-15T18:39:19.621Z","target_branch":"a","source_branch":"b","upvotes":0,"downvotes":0,"author":{"id":1,"name":"admin","username":"admin","state":"active","avatar_url":"https://gitlab.example.com/uploads/-/system/user/avatar/1/avatar.png","web_url":"https://gitlab.example.com/admin"},"assignee":null,"source_project_id":1,"target_project_id":1,"labels":[],"work_in_progress":false,"milestone":null,"merge_when_pipeline_succeeds":false,"merge_status":"can_be_merged","sha":"8d35ce134dc1dc52b8060c413a8a47964e1d5c92","merge_commit_sha":"ca0eedb9ca03107d1bb62a4c98498bc35b2e17eb","user_notes_count":0,"discussion_locked":null,"should_remove_source_branch":null,"force_remove_source_branch":true,"web_url":"https://gitlab.example.com/example-group/example-project/merge_requests/1","time_stats":{"time_estimate":0,"total_time_spent":0,"human_time_estimate":null,"human_total_time_spent":null},"approvals_before_merge":null,"squash":false},{"id":2,"iid":2,"project_id":1,"title":"Title","description":"","state":"merged","created_at":"2018-05-15T18:39:39.528Z","updated_at":"2018-05-15T18:39:47.013Z","target_branch":"master","source_branch":"a","upvotes":0,"downvotes":0,"author":{"id":2,"name":"admin2","username":"admin2","state":"active","avatar_url":"https://gitlab.example.com/uploads/-/system/user/avatar/2/avatar.png","web_url":"https://gitlab.example.com/admin2"},"assignee":null,"source_project_id":1,"target_project_id":1,"labels":[],"work_in_progress":false,"milestone":null,"merge_when_pipeline_succeeds":false,"merge_status":"can_be_merged","sha":"ca0eedb9ca03107d1bb62a4c98498bc35b2e17eb","merge_commit_sha":"a5d1608991cec904a63c95eeed59d14caef43336","user_notes_count":0,"discussion_locked":null,"should_remove_source_branch":null,"force_remove_source_branch":true,"web_url":"https://gitlab.example.com/example-group/example-project/merge_requests/2","time_stats":{"time_estimate":0,"total_time_spent":0,"human_time_estimate":null,"human_total_time_spent":null},"approvals_before_merge":null,"squash":false}]
0 [
1 {
2 "id": 496,
3 "sha": "7d938cb8ac15788d71f4b67c035515a160ea76d8",
4 "ref": "decreased-spec",
5 "status": "failed",
6 "name": "test",
7 "target_url": null,
8 "description": null,
9 "created_at": "2015-10-23T23:35:48.693+02:00",
10 "started_at": null,
11 "finished_at": "2015-10-23T23:35:48.716+02:00",
12 "author": {
13 "name": "Dominik Sander",
14 "username": "dsander",
15 "id": 1,
16 "state": "active",
17 "avatar_url": "https://secure.gravatar.com/avatar/xxxxx?s=40&d=identicon",
18 "web_url": "https://github.com/u/dsander"
19 }
20 },
21 {
22 "id": 493,
23 "sha": "7d938cb8ac15788d71f4b67c035515a160ea76d8",
24 "ref": "decreased-spec",
25 "status": "success",
26 "name": "specs",
27 "target_url": "https://github.com/dsander/omniauth/builds/493",
28 "description": null,
29 "created_at": "2015-10-23T21:39:19.384+02:00",
30 "started_at": "2015-10-23T21:39:21.900+02:00",
31 "finished_at": "2015-10-23T21:39:35.215+02:00",
32 "author": {
33 "name": "Dominik Sander",
34 "username": "dsander",
35 "id": 1,
36 "state": "active",
37 "avatar_url": "https://secure.gravatar.com/avatar/xxxxx?s=40&d=identicon",
38 "web_url": "https://github.com/u/dsander"
39 }
40 }
41 ]
0 [{"id":"f7dd067490fe57505f7226c3b54d3127d2f7fd46","short_id":"f7dd067490f","title":"API: expose issues project id","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-25T04:22:21-07:00"},{"id":"949b1df930bedace1dbd755aaa4a82e8c451a616","short_id":"949b1df930b","title":"API: update docs","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-25T02:35:41-07:00"},{"id":"1b95c8bff351f6718ec31ac1de1e48c57bc95d44","short_id":"1b95c8bff35","title":"API: ability to get project by id","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-25T02:18:30-07:00"},{"id":"92d98f5a0c28bffd7b070cda190b07ab72667d58","short_id":"92d98f5a0c2","title":"Merge pull request #1118 from patthoyts/pt/ldap-missing-password","author_name":"Dmitriy Zaporozhets","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-25T01:51:06-07:00"},{"id":"60d3e94874964a626f105d3598e1c122addcf43e","short_id":"60d3e948749","title":"Merge pull request #1122 from patthoyts/pt/missing-log","author_name":"Dmitriy Zaporozhets","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-25T01:50:34-07:00"},{"id":"b683a71aa1230f17f9df47661c77dfeae27027de","short_id":"b683a71aa12","title":"Merge pull request #1135 from NARKOZ/api","author_name":"Dmitriy Zaporozhets","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-25T01:48:00-07:00"},{"id":"fbb41100db35cf2def2c8b4d896b7015d56bd15b","short_id":"fbb41100db3","title":"update help section with issues API docs","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-24T05:52:43-07:00"},{"id":"eca823c1c7cef45cc18c6ab36d2327650c85bfc3","short_id":"eca823c1c7c","title":"Merge branch 'master' into api","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-24T05:46:36-07:00"},{"id":"024e0348904179a8dea81c01e27a5f014cf57499","short_id":"024e0348904","title":"update API docs","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-24T05:25:01-07:00"},{"id":"7b33d8cbcab3b0ee5789ec607455ab62130db69f","short_id":"7b33d8cbcab","title":"add issues API","author_name":"Nihad Abbasov","author_email":"narkoz.2008@gmail.com","created_at":"2012-07-24T05:19:51-07:00"},{"id":"6035ad7e1fe519d0c6a42731790183889e3ba31d","short_id":"6035ad7e1fe","title":"Create the githost.log file if necessary.","author_name":"Pat Thoyts","author_email":"patthoyts@users.sourceforge.net","created_at":"2012-07-21T07:32:04-07:00"},{"id":"a2d244ec062f3348f6cd1c5218c6097402c5f562","short_id":"a2d244ec062","title":"Handle LDAP missing credentials error with a flash message.","author_name":"Pat Thoyts","author_email":"patthoyts@users.sourceforge.net","created_at":"2012-07-21T01:04:05-07:00"},{"id":"8b7e404b5b6944e9c92cc270b2e5d0005781d49d","short_id":"8b7e404b5b6","title":"Up to 2.7.0","author_name":"randx","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-21T00:53:55-07:00"},{"id":"11721b0dbe82c35789be3e4fa8e14663934b2ff5","short_id":"11721b0dbe8","title":"Help section for system hooks completed","author_name":"randx","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-21T00:47:57-07:00"},{"id":"9c8a1e651716212cf50a623d98e03b8dbdb2c64a","short_id":"9c8a1e65171","title":"Fix system hook example","author_name":"randx","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-21T00:32:42-07:00"},{"id":"4261acda90ff4c61326d80cba026ae76e8551f8f","short_id":"4261acda90f","title":"move SSH keys tab closer to begining","author_name":"randx","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-21T00:27:09-07:00"},{"id":"a69fc5dd23bd502fd36892a80eec21a4c53891f8","short_id":"a69fc5dd23b","title":"Endless event loading for dsahboard","author_name":"randx","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-21T00:23:05-07:00"},{"id":"860fa1163a5fbdfec2bb01ff2d584351554dee29","short_id":"860fa1163a5","title":"Merge pull request #1117 from patthoyts/pt/user-form","author_name":"Dmitriy Zaporozhets","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-20T14:23:49-07:00"},{"id":"787e5e94acf5e20280416c9fda105ef5b77576b3","short_id":"787e5e94acf","title":"Fix english on the edit user form.","author_name":"Pat Thoyts","author_email":"patthoyts@users.sourceforge.net","created_at":"2012-07-20T14:18:42-07:00"},{"id":"9267cb04b0b3fdf127899c4b7e636dc27fac06d3","short_id":"9267cb04b0b","title":"Merge branch 'refactoring_controllers' of dev.gitlabhq.com:gitlabhq","author_name":"Dmitriy Zaporozhets","author_email":"dmitriy.zaporozhets@gmail.com","created_at":"2012-07-20T07:24:56-07:00"}]
0 {
1 "id":3,
2 "code":"gitlab",
3 "name":"Gitlab-edit",
4 "description":null,
5 "path":"gitlab",
6 "default_branch":null,
7 "owner":{
8 "id":1,
9 "email":"john@example.com",
10 "name":"John Smith",
11 "blocked":false,
12 "created_at":"2012-09-17T09:41:56Z"
13 },
14 "public":false,
15 "issues_enabled":true,
16 "merge_requests_enabled":true,
17 "wall_enabled":true,
18 "wiki_enabled":true,
19 "created_at":"2012-09-17T09:41:58Z"
20 }
0 [
1 {
2 "title":null,
3 "project_id":1,
4 "action_name":"opened",
5 "target_id":160,
6 "target_iid":160,
7 "target_type":"Issue",
8 "author_id":25,
9 "target_title":"Qui natus eos odio tempore et quaerat consequuntur ducimus cupiditate quis.",
10 "created_at":"2017-02-09T10:43:19.667Z",
11 "author":{
12 "name":"User 3",
13 "username":"user3",
14 "id":25,
15 "state":"active",
16 "avatar_url":"http://www.gravatar.com/avatar/97d6d9441ff85fdc730e02a6068d267b?s=80\u0026d=identicon",
17 "web_url":"https://gitlab.example.com/user3"
18 },
19 "author_username":"user3"
20 },
21 {
22 "title":null,
23 "project_id":1,
24 "action_name":"opened",
25 "target_id":159,
26 "target_iid":159,
27 "target_type":"Issue",
28 "author_id":21,
29 "target_title":"Nostrum enim non et sed optio illo deleniti non.",
30 "created_at":"2017-02-09T10:43:19.426Z",
31 "author":{
32 "name":"Test User",
33 "username":"ted",
34 "id":21,
35 "state":"active",
36 "avatar_url":"http://www.gravatar.com/avatar/80fb888c9a48b9a3f87477214acaa63f?s=80\u0026d=identicon",
37 "web_url":"https://gitlab.example.com/ted"
38 },
39 "author_username":"ted"
40 },
41 {
42 "title": null,
43 "project_id": 1,
44 "action_name": "commented on",
45 "target_id": 1312,
46 "target_iid": 1312,
47 "target_type": "Note",
48 "author_id": 1,
49 "data": null,
50 "target_title": null,
51 "created_at": "2015-12-04T10:33:58.089Z",
52 "note": {
53 "id": 1312,
54 "body": "What an awesome day!",
55 "attachment": null,
56 "author": {
57 "name": "Dmitriy Zaporozhets",
58 "username": "root",
59 "id": 1,
60 "state": "active",
61 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
62 "web_url": "http://localhost:3000/root"
63 },
64 "created_at": "2015-12-04T10:33:56.698Z",
65 "system": false,
66 "noteable_id": 377,
67 "noteable_type": "Issue",
68 "noteable_iid": 377
69 },
70 "author": {
71 "name": "Dmitriy Zaporozhets",
72 "username": "root",
73 "id": 1,
74 "state": "active",
75 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
76 "web_url": "http://localhost:3000/root"
77 },
78 "author_username": "root"
79 }
80 ]
0 {"id":1,"code":"brute","name":"Brute","description":null,"path":"brute","default_branch":null,"owner":{"id":1,"email":"john@example.com","name":"John Owner","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"private":true,"issues_enabled":true,"merge_requests_enabled":true,"wall_enabled":true,"wiki_enabled":true,"created_at":"2012-09-17T09:41:56Z"}
0 {
1 "id":20,
2 "description":"desc",
3 "default_branch":"master",
4 "tag_list":[
5
6 ],
7 "public":false,
8 "archived":false,
9 "visibility_level":10,
10 "ssh_url_to_repo":"git@git.gitlab.com:root/gitlab.git",
11 "http_url_to_repo":"http://git.gitlab.com/root/gitlab.git",
12 "web_url":"http://git.gitlab.com/root/gitlab",
13 "owner":{
14 "name":"Administrator",
15 "username":"root",
16 "id":1,
17 "state":"active",
18 "avatar_url":"http://git.gitlab.com/uploads/user/avatar/1/12586377.jpeg"
19 },
20 "name":"gitlab",
21 "name_with_namespace":"Administrator / gitlab",
22 "path":"gitlab",
23 "path_with_namespace":"root/gitlab",
24 "issues_enabled":true,
25 "merge_requests_enabled":true,
26 "wiki_enabled":true,
27 "snippets_enabled":false,
28 "created_at":"2015-06-08T01:29:17.190Z",
29 "last_activity_at":"2015-06-08T01:29:17.190Z",
30 "creator_id":1,
31 "namespace":{
32 "id":1,
33 "name":"root",
34 "path":"root",
35 "owner_id":1,
36 "created_at":"2015-05-28T19:23:40.445Z",
37 "updated_at":"2015-05-28T19:23:40.445Z",
38 "description":"",
39 "avatar":null
40 },
41 "forked_from_project":{
42 "id":3,
43 "name":"Gitlab",
44 "name_with_namespace":"Root / gitlab",
45 "path":"gitlab",
46 "path_with_namespace":"root/gitlab"
47 },
48 "avatar_url":null
49 }
0 {"created_at":"2013-07-03T13:51:48Z","forked_from_project_id":24,"forked_to_project_id":42,"id":1,"updated_at":"2013-07-03T13:51:48Z"}
0 {
1 "id":20,
2 "description":"desc",
3 "default_branch":"master",
4 "tag_list":[
5
6 ],
7 "public":false,
8 "archived":false,
9 "visibility_level":10,
10 "ssh_url_to_repo":"git@git.gitlab.com:root/gitlab.git",
11 "http_url_to_repo":"http://git.gitlab.com/root/gitlab.git",
12 "web_url":"http://git.gitlab.com/root/gitlab",
13 "owner":{
14 "name":"Jack Smith",
15 "username":"jack.smith",
16 "id":2,
17 "state":"active",
18 "avatar_url":"http://git.gitlab.com/uploads/user/avatar/1/12586377.jpeg"
19 },
20 "name":"gitlab",
21 "name_with_namespace":"Jack Smith / gitlab",
22 "path":"gitlab",
23 "path_with_namespace":"jack.smith/gitlab",
24 "issues_enabled":true,
25 "merge_requests_enabled":true,
26 "wiki_enabled":true,
27 "snippets_enabled":false,
28 "created_at":"2015-06-08T01:29:17.190Z",
29 "last_activity_at":"2015-06-08T01:29:17.190Z",
30 "creator_id":1,
31 "namespace":{
32 "id":1,
33 "name":"jack.smith",
34 "path":"jack.smith",
35 "owner_id":2,
36 "created_at":"2015-05-28T19:23:40.445Z",
37 "updated_at":"2015-05-28T19:23:40.445Z",
38 "description":"",
39 "avatar":null
40 },
41 "forked_from_project":{
42 "id":3,
43 "name":"Gitlab",
44 "name_with_namespace":"Root / gitlab",
45 "path":"gitlab",
46 "path_with_namespace":"root/gitlab"
47 },
48 "avatar_url":null
49 }
0 [{
1 "id":20,
2 "description":"desc",
3 "default_branch":"master",
4 "tag_list":[
5
6 ],
7 "public":false,
8 "archived":false,
9 "visibility_level":10,
10 "ssh_url_to_repo":"git@git.gitlab.com:root/gitlab.git",
11 "http_url_to_repo":"http://git.gitlab.com/root/gitlab.git",
12 "web_url":"http://git.gitlab.com/root/gitlab",
13 "owner":{
14 "name":"Administrator",
15 "username":"root",
16 "id":1,
17 "state":"active",
18 "avatar_url":"http://git.gitlab.com/uploads/user/avatar/1/12586377.jpeg"
19 },
20 "name":"gitlab",
21 "name_with_namespace":"Administrator / gitlab",
22 "path":"gitlab",
23 "path_with_namespace":"root/gitlab",
24 "issues_enabled":true,
25 "merge_requests_enabled":true,
26 "wiki_enabled":true,
27 "snippets_enabled":false,
28 "created_at":"2015-06-08T01:29:17.190Z",
29 "last_activity_at":"2015-06-08T01:29:17.190Z",
30 "creator_id":1,
31 "namespace":{
32 "id":1,
33 "name":"root",
34 "path":"root",
35 "owner_id":1,
36 "created_at":"2015-05-28T19:23:40.445Z",
37 "updated_at":"2015-05-28T19:23:40.445Z",
38 "description":"",
39 "avatar":null
40 },
41 "forked_from_project":{
42 "id":3,
43 "name":"Gitlab",
44 "name_with_namespace":"Root / gitlab",
45 "path":"gitlab",
46 "path_with_namespace":"root/gitlab"
47 },
48 "avatar_url":null
49 }]
0 {"id":1,"url":"https://api.example.net/v1/webhooks/ci"}
0 [{"id":1,"url":"https://api.example.net/v1/webhooks/ci"}]
0 [{"id":36,"project_id":3,"title":"Eos ut modi et laudantium quasi porro voluptas sed.","description":null,"labels":[],"milestone":null,"assignee":{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":35,"project_id":3,"title":"Ducimus illo in iure voluptatem dolores labore.","description":null,"labels":[],"milestone":null,"assignee":{"id":4,"email":"nicole@mertz.com","name":"Felipe Davis","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":4,"email":"nicole@mertz.com","name":"Felipe Davis","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":34,"project_id":3,"title":"Rem tempora voluptatum atque eum sit nihil neque.","description":null,"labels":[],"milestone":null,"assignee":{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":33,"project_id":3,"title":"Beatae possimus nostrum nihil reiciendis laboriosam nihil delectus alias accusantium dolor unde.","description":null,"labels":[],"milestone":null,"assignee":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":32,"project_id":3,"title":"Deserunt tenetur impedit est beatae voluptas voluptas quaerat quisquam.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":16,"project_id":3,"title":"Numquam earum aut laudantium reprehenderit voluptatem aut.","description":null,"labels":[],"milestone":null,"assignee":{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":15,"project_id":3,"title":"Qui veritatis voluptas fuga voluptate voluptas cupiditate.","description":null,"labels":[],"milestone":null,"assignee":{"id":4,"email":"nicole@mertz.com","name":"Felipe Davis","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":4,"email":"nicole@mertz.com","name":"Felipe Davis","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":14,"project_id":3,"title":"In assumenda et ipsa qui debitis voluptatem incidunt.","description":null,"labels":[],"milestone":null,"assignee":{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":13,"project_id":3,"title":"Illo eveniet consequatur enim iste provident facilis rerum voluptatem et architecto aut.","description":null,"labels":[],"milestone":null,"assignee":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"author":{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"},{"id":12,"project_id":3,"title":"Veniam et tempore quidem eum reprehenderit cupiditate non aut velit eaque.","description":null,"labels":[],"milestone":null,"assignee":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"closed":false,"updated_at":"2012-09-17T09:42:20Z","created_at":"2012-09-17T09:42:20Z"}]
0 {
1 "id": 2,
2 "title": "Key Title",
3 "key": "ssh-rsa ...",
4 "can_push": false,
5 "created_at": "2013-09-22T18:34:32Z"
6 }
0 [{
1 "id": 2,
2 "title": "Key Title",
3 "key": "ssh-rsa ...",
4 "can_push": false,
5 "created_at": "2013-09-22T18:34:32Z"
6 }]
0 {
1 "approvers": [
2 {
3 "user": {
4 "id": 5,
5 "name": "John Doe6",
6 "username": "user5",
7 "state":"active","avatar_url":"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80\u0026d=identicon","web_url":"http://localhost/user5"
8 }
9 }
10 ],
11 "approver_groups": [
12 {
13 "group": {
14 "id": 1,
15 "name": "group1",
16 "path": "group1",
17 "description": "",
18 "visibility": "public",
19 "lfs_enabled": false,
20 "avatar_url": null,
21 "web_url": "http://localhost/groups/group1",
22 "request_access_enabled": false,
23 "full_name": "group1",
24 "full_path": "group1",
25 "parent_id": null,
26 "ldap_cn": null,
27 "ldap_access": null
28 }
29 }
30 ],
31 "approvals_before_merge": 3,
32 "reset_approvals_on_push": false,
33 "disable_overriding_approvers_per_merge_request": true
34 }
0 {
1 "active": true,
2 "description": "test-2016-02-01",
3 "id": 9,
4 "is_shared": false,
5 "name": null
6 }
0 [
1 {
2 "active": true,
3 "description": "test-2-20150125",
4 "id": 8,
5 "is_shared": false,
6 "name": null
7 },
8 {
9 "active": true,
10 "description": "development_runner",
11 "id": 5,
12 "is_shared": true,
13 "name": null
14 }
15 ]
0 [{"id":3,"code":"gitlab","name":"Gitlab","description":null,"path":"gitlab","default_branch":null,"owner":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"private":true,"issues_enabled":true,"merge_requests_enabled":true,"wall_enabled":true,"wiki_enabled":true,"created_at":"2012-09-17T09:41:58Z"}]
0 {
1 "id": 3,
2 "description": null,
3 "default_branch": "master",
4 "public": false,
5 "visibility_level": 10,
6 "ssh_url_to_repo":"git@git.gitlab.com:root/gitlab.git",
7 "http_url_to_repo":"http://git.gitlab.com/root/gitlab.git",
8 "web_url":"http://git.gitlab.com/root/gitlab",
9 "tag_list": [
10
11 ],
12 "name": "GitLab Community Edition",
13 "name_with_namespace": "GitLab / GitLab Community Edition",
14 "path": "gitlab-ce",
15 "path_with_namespace": "gitlab/gitlab-ce",
16 "issues_enabled": true,
17 "open_issues_count": 1,
18 "merge_requests_enabled": true,
19 "builds_enabled": true,
20 "wiki_enabled": true,
21 "snippets_enabled": false,
22 "container_registry_enabled": false,
23 "created_at": "2013-09-30T13:46:02Z",
24 "last_activity_at": "2013-09-30T13:46:02Z",
25 "creator_id": 3,
26 "namespace": {
27 "created_at": "2013-09-30T13:46:02Z",
28 "description": "",
29 "id": 3,
30 "name": "GitLab",
31 "owner_id": 1,
32 "path": "gitlab",
33 "updated_at": "2013-09-30T13:46:02Z"
34 },
35 "archived": true,
36 "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
37 "shared_runners_enabled": true,
38 "forks_count": 0,
39 "star_count": 1,
40 "public_builds": true,
41 "shared_with_groups": [],
42 "only_allow_merge_if_build_succeeds": false
43 }
0 {"name": "v1.1.0","message": "Release 1.1.0","commit": {"id": "2695effb5807a22ff3d138d593fd856244e155e7","parents": [],"message": "Initial commit","authored_date": "2012-05-28T04:42:42-07:00","author_name": "John Smith","author email": "john@example.com","committer_name": "Jack Smith","committed_date": "2012-05-28T04:42:42-07:00","committer_email": "jack@example.com"}}
0 {"name": "v1.0.0","message": null,"commit": {"id": "2695effb5807a22ff3d138d593fd856244e155e7","parents": [],"message": "Initial commit","authored_date": "2012-05-28T04:42:42-07:00","author_name": "John Smith","author email": "john@example.com","committer_name": "Jack Smith","committed_date": "2012-05-28T04:42:42-07:00","committer_email": "jack@example.com"}}
0 [{"name":"v2.8.2","commit":{"id":"a502f67c0b358cc6b391df0c5dca48375c21fcad","parents":[{"id":"4381084af341684240b1a671d368511afcf5774a"}],"tree":"1612068bdd20de5d14b3096cfa4c621e2051ed4c","message":"Up to 2.8.2","author":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-08-24T02:03:48-07:00","committed_date":"2012-08-24T02:03:48-07:00"}},{"name":"v2.8.1","commit":{"id":"ed2b53cd1c34c421b23208eeb502a141a6829f9d","parents":[{"id":"7ab587a47791e371f5c109c14097a5d1d7776ea5"}],"tree":"b7393b0b33b777583b285e85b423c4e5ab7f859f","message":"Up to 2.8.1","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-08-22T23:17:18-07:00","committed_date":"2012-08-22T23:17:18-07:00"}},{"name":"v2.8.0pre","commit":{"id":"b2c6ba97a25d299e83c51493d7bc770c13b8ed1a","parents":[{"id":"05da3801f53f06fdc529b4f3820af1380039f245"},{"id":"66399d558da45fb9cd3ea972a47a4f7bb12bfc8d"}],"tree":"36ad53f35bce1fe3f2a4a5f840e7b1bdbfed9c82","message":"Merge pull request #1230 from tsigo/hooray_apostrophes\n\nCorrect usage of \"Can't\"","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-08-16T14:11:08-07:00","committed_date":"2012-08-16T14:11:08-07:00"}},{"name":"v2.8.0","commit":{"id":"5c7ed6fa26b47ac71ff6ba04720d85df6d74b200","parents":[{"id":"d1daeba1736ba145fe525ce08a91f29495a3abf1"}],"tree":"4fc230ff2dbc0e75f27321eac2976aba5a6d323d","message":"Up to 2.8","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-08-21T15:15:26-07:00","committed_date":"2012-08-21T15:15:26-07:00"}},{"name":"v2.7.0pre","commit":{"id":"72a571724d84d112f98a5543c971e9b3b9da1383","parents":[{"id":"3ac840ff06e0ee5b349c52b5a8c02e803a17eec3"},{"id":"990b9217d9a55e26a53d4143d4a3c89123384327"}],"tree":"64b104df5d956e21e0749dc8e70849d1989de36f","message":"Merge pull request #1096 from moregeek/show-flash-note-when-destroying-a-project\n\nshow flash notice after deletion of a project","author":{"name":"Valeriy Sizov","email":"vsv2711@gmail.com"},"committer":{"name":"Valeriy Sizov","email":"vsv2711@gmail.com"},"authored_date":"2012-07-18T05:35:42-07:00","committed_date":"2012-07-18T05:35:42-07:00"}},{"name":"v2.7.0","commit":{"id":"8b7e404b5b6944e9c92cc270b2e5d0005781d49d","parents":[{"id":"11721b0dbe82c35789be3e4fa8e14663934b2ff5"}],"tree":"89fe8c5ff58daaedea07a910cffb14b04ebcc828","message":"Up to 2.7.0","author":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-07-21T00:53:55-07:00","committed_date":"2012-07-21T00:53:55-07:00"}},{"name":"v2.6.3","commit":{"id":"666cdb22792dd955a286b9993d6235b4cdd68b4b","parents":[{"id":"d92446df1fdba87101c92c90b1c34eb2f1eebef4"}],"tree":"888173aa4c12a4920d318c35b950095d3505673d","message":"up to 2.6.3","author":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-06-26T09:20:47-07:00","committed_date":"2012-06-26T09:21:28-07:00"}},{"name":"v2.6.2","commit":{"id":"39fecb554f172a0c8ea00316e612e1d37efc7200","parents":[{"id":"68389588d664100590b1a6ca7eedd50860b7e9bc"}],"tree":"53accb25e0b9d038d550cf387753bde15fe4ad19","message":"Up to 2.6.2","author":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-06-22T13:50:58-07:00","committed_date":"2012-06-22T13:50:58-07:00"}},{"name":"v2.6.1","commit":{"id":"d92a22c9e627268eca697bbd9b660d8c335df953","parents":[{"id":"193804516b8b0783c850981456e947f888ff51bb"}],"tree":"4ac1b5225f597ab55372cb5e950b121d6f55e386","message":"Up to 2.6.1","author":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-06-22T12:49:03-07:00","committed_date":"2012-06-22T12:49:03-07:00"}},{"name":"v2.6.0","commit":{"id":"b32465712becfbcf83d63b1e6eff7d1483fdabea","parents":[{"id":"1903f6ade027df0f10ef96b9439495eeda07482c"}],"tree":"ffbc05fd0f1771c1602c956df9556260048c7167","message":"Up to 2.6","author":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"randx","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-06-21T10:25:23-07:00","committed_date":"2012-06-21T10:25:23-07:00"}},{"name":"v2.5.0","commit":{"id":"cc8369144db2147d2956e8dd7d314e9a7dfd4fbb","parents":[{"id":"1b2068eaa91e5002d01a220c65da21dad8ccb071"}],"tree":"666a442e00689911169e8cc336c5ce60d014854c","message":"Prevent app crash in case if encoding failed","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-05-22T04:57:04-07:00","committed_date":"2012-05-22T04:57:04-07:00"}},{"name":"v2.4.2","commit":{"id":"f18339c26d673c5f8b4c19776036fd42a0de30aa","parents":[{"id":"c937d06c3c98e9ffce8ec1132203eaff6bf7b231"},{"id":"35e602f19c83585d64aa2043ed26eeb8cd7b40e2"}],"tree":"5101f0cd8e395fee1996764298a202437757e85b","message":"Merge branch 'master' of github.com:gitlabhq/gitlabhq","author":{"name":"Zevs","email":"vsv2711@gmail.com"},"committer":{"name":"Zevs","email":"vsv2711@gmail.com"},"authored_date":"2012-04-29T14:24:59-07:00","committed_date":"2012-04-29T14:24:59-07:00"}},{"name":"v2.4.1","commit":{"id":"d97a9aa4a44ff9f452144fad348fd9d7e3b48260","parents":[{"id":"21f3da23589d50038728393f0badc6255b5762ca"}],"tree":"905c33874b064778199f806749d5688e33d64be3","message":"fixed email markdown","author":{"name":"gitlabhq","email":"m@gitlabhq.com"},"committer":{"name":"gitlabhq","email":"m@gitlabhq.com"},"authored_date":"2012-04-23T05:32:56-07:00","committed_date":"2012-04-23T05:32:56-07:00"}},{"name":"v2.4.0pre","commit":{"id":"1845429268364e75bffdeb1075de8f1606e157ec","parents":[{"id":"45b18365d5f409f196a02a4e6e2b77b8ebef909b"}],"tree":"423c70246fa7ffd8804b26628fea34bdb2b22846","message":"Use try for commit prev_commit_id detection","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-04-19T13:35:35-07:00","committed_date":"2012-04-19T13:35:35-07:00"}},{"name":"v2.4.0","commit":{"id":"204c66461ed519eb0078be7e8ac8a6cb56834753","parents":[{"id":"511d07c47c9bf3a18bfa276d452c899369432a22"}],"tree":"9416c777cccf87d348f5705078e82f3f97485e19","message":"corrected exception for automerge","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-04-22T06:49:45-07:00","committed_date":"2012-04-22T06:49:45-07:00"}},{"name":"v2.3.1","commit":{"id":"fa8219e0a753e642a6f1dbdfc010d01ae8a949ee","parents":[{"id":"81da8e46f24913ccf42d3e2644962cbcbc0f9c2e"}],"tree":"5debfcd6d17f9d582aace6ac9b80db27d5c1fe36","message":"better MR list, dashboard pollished","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-03-22T13:57:04-07:00","committed_date":"2012-03-22T13:57:04-07:00"}},{"name":"v2.3.0pre","commit":{"id":"cadf12c60cc27c5b0b8273c1de4b190a0e88bd7d","parents":[{"id":"724ea16c348bc61cf7cb3dbe362c6f30cff1b2c7"}],"tree":"6f4c22761fd2dee405d3fbf38f9dd835bb3c8694","message":"Merged activities & projects pages","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-03-19T15:05:35-07:00","committed_date":"2012-03-19T15:05:35-07:00"}},{"name":"v2.3.0","commit":{"id":"b57faf9282d7df6cdd62953d474652a0ae2e6896","parents":[{"id":"cadf12c60cc27c5b0b8273c1de4b190a0e88bd7d"}],"tree":"f0d5b826df373191b4681452fc2ae4c5970cef4a","message":"Push events polished","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-03-20T14:59:35-07:00","committed_date":"2012-03-20T14:59:35-07:00"}},{"name":"v2.2.0pre","commit":{"id":"6a445b42003007cbb6c06f477c4d7a0b175688c1","parents":[{"id":"22f4c1908d0fc2dbce02e74ed03bf65f028d78d6"}],"tree":"9c60577833f6ca717acdebfa66140124c88e8471","message":"fixed forgot password form","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-02-20T10:37:37-08:00","committed_date":"2012-02-20T10:37:37-08:00"}},{"name":"v2.2.0","commit":{"id":"9e6d0710e927aa8ea834b8a9ae9f277be617ac7d","parents":[{"id":"8c40aab120dbc5507ab9cc8d7ad8e2519d6e9f25"},{"id":"6ea87c47f0f8a24ae031c3fff17bc913889ecd00"}],"tree":"86c831ab21236f21ffa5b97c752369612ce41b39","message":"Merge pull request #443 from CedricGatay/fix/incorrectLineNumberingInDiff\n\nIncorrect line numbering in diff","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-02-22T07:14:54-08:00","committed_date":"2012-02-22T07:14:54-08:00"}},{"name":"v2.1.0","commit":{"id":"98d6492582d232ed86525aa31ccbf280f4cbdaef","parents":[{"id":"611c5a87ab0c083a43785323b09cc47f554c3ba4"}],"tree":"1689b3cad580a18fd9b429ee0b33dac21c9f5a48","message":"removed broken migration","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2012-01-22T10:52:06-08:00","committed_date":"2012-01-22T10:52:06-08:00"}},{"name":"v2.0.0","commit":{"id":"9a2a8612769d472503b367fa35e99f6fb2876704","parents":[{"id":"2f7b67161952fc9ab322eba6878511b5f2dd5cf1"}],"tree":"26cdb4e66b5e664fe4bcd57d011c54c9c9c26ded","message":"Design tab for profile. Colorscheme as db value","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2011-12-20T12:47:09-08:00","committed_date":"2011-12-20T12:47:09-08:00"}},{"name":"v1.2.2","commit":{"id":"139a332293b9d8c4e5436619036e093483d8347f","parents":[{"id":"ade12da9488bea19d12505c371ead35686a1436e"}],"tree":"365d57f4df5c5dcac69b666cf6d2bfd8ef058008","message":"updated readme","author":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"authored_date":"2011-11-25T14:30:51-08:00","committed_date":"2011-11-25T14:30:51-08:00"}},{"name":"v1.2.1","commit":{"id":"7ebba27db21719c0035bab65fea92a4780051c73","parents":[{"id":"b56024100d40457a998f83adae3cdc830c997cda"},{"id":"a4fbe13fce87cb6ff2a27a2574ae25bf1dad145c"}],"tree":"b121a7576af1503a96954ce9a94598a68579e053","message":"Merge branch 'master' of dev.gitlabhq.com:gitlabhq","author":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"authored_date":"2011-11-22T13:15:09-08:00","committed_date":"2011-11-22T13:15:09-08:00"}},{"name":"v1.2.0pre","commit":{"id":"86829cae50857b5edf74b935380c6f68a19c2282","parents":[{"id":"a6b99319381c2d62ec4b92d64805e8de8965859e"}],"tree":"6aab9d13000584fa96fb3cb34d94f3b122bd1143","message":"fixed min height for menu","author":{"name":"gitlabhq","email":"m@gitlabhq.com"},"committer":{"name":"gitlabhq","email":"m@gitlabhq.com"},"authored_date":"2011-11-22T06:03:27-08:00","committed_date":"2011-11-22T06:03:27-08:00"}},{"name":"v1.2.0","commit":{"id":"b56024100d40457a998f83adae3cdc830c997cda","parents":[{"id":"4451b8df8ad6d4b6d79fbce77687c6c2fd37d0a9"}],"tree":"f402cbb6d54526a32b30968c98410bae97b27c8d","message":"lil style fixes","author":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"authored_date":"2011-11-22T09:57:25-08:00","committed_date":"2011-11-22T09:57:25-08:00"}},{"name":"v1.1.0pre","commit":{"id":"6b030fd41d697e327d2935b406cba70b6a460504","parents":[{"id":"3a2b273316fb29d63b489906f85d9b5329377258"}],"tree":"63b1fdb2a0f135f7074f6a94da14543b8450dd71","message":"1.1pre1","author":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"authored_date":"2011-10-21T10:04:41-07:00","committed_date":"2011-10-21T10:04:41-07:00"}},{"name":"v1.1.0","commit":{"id":"ba8048d71019b5aaa1f92ee5c3415bfddaa9babb","parents":[{"id":"6b030fd41d697e327d2935b406cba70b6a460504"}],"tree":"4db2b5f4f9b374dd1be3579459bc5947c225c9ba","message":"v1.1.0","author":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"authored_date":"2011-10-22T06:07:26-07:00","committed_date":"2011-10-22T06:07:26-07:00"}},{"name":"v1.0.2","commit":{"id":"3a2b273316fb29d63b489906f85d9b5329377258","parents":[{"id":"757ea634665e475bf69c1ec962040a0511ee8aeb"},{"id":"c374eb80ff9fb71d37faffc15714bf98b632d3e5"}],"tree":"e0d8170e61a9468a7bb5d4e63305171ec1efa6bf","message":"Merge pull request #40 from vslinko/patch-1\n\nIncrease max key length. Some keys has comment after key string.","author":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dmitriy.zaporozhets@gmail.com"},"authored_date":"2011-10-18T23:30:06-07:00","committed_date":"2011-10-18T23:30:06-07:00"}},{"name":"v1.0.1","commit":{"id":"7b5799a97998b68416f1b6233ce427135c99165a","parents":[{"id":"0541b3f3c5dcd291d144c83d9731c75ee811b4e0"},{"id":"7b67480c76db8b9a9ccdc80015cc500dc6d26892"}],"tree":"e052185e9dd72a1b1a04d59a5f9efbf3c0369601","message":"Merge branch '1x' of github.com:gitlabhq/gitlabhq into 1x","author":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"committer":{"name":"Dmitriy Zaporozhets","email":"dzaporozhets@sphereconsultinginc.com"},"authored_date":"2011-10-14T15:16:44-07:00","committed_date":"2011-10-14T15:16:44-07:00"}}]
0 {
1 "id": 3,
2 "description": null,
3 "default_branch": "master",
4 "public": false,
5 "visibility_level": 10,
6 "ssh_url_to_repo":"git@git.gitlab.com:root/gitlab.git",
7 "http_url_to_repo":"http://git.gitlab.com/root/gitlab.git",
8 "web_url":"http://git.gitlab.com/root/gitlab",
9 "tag_list": [
10
11 ],
12 "name": "GitLab Community Edition",
13 "name_with_namespace": "GitLab / GitLab Community Edition",
14 "path": "gitlab-ce",
15 "path_with_namespace": "gitlab/gitlab-ce",
16 "issues_enabled": true,
17 "open_issues_count": 1,
18 "merge_requests_enabled": true,
19 "builds_enabled": true,
20 "wiki_enabled": true,
21 "snippets_enabled": false,
22 "container_registry_enabled": false,
23 "created_at": "2013-09-30T13:46:02Z",
24 "last_activity_at": "2013-09-30T13:46:02Z",
25 "creator_id": 3,
26 "namespace": {
27 "created_at": "2013-09-30T13:46:02Z",
28 "description": "",
29 "id": 3,
30 "name": "GitLab",
31 "owner_id": 1,
32 "path": "gitlab",
33 "updated_at": "2013-09-30T13:46:02Z"
34 },
35 "archived": true,
36 "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
37 "shared_runners_enabled": true,
38 "forks_count": 0,
39 "star_count": 0,
40 "public_builds": true,
41 "shared_with_groups": [],
42 "only_allow_merge_if_build_succeeds": false
43 }
0 {
1 "id": 498,
2 "sha": "7d938cb8ac15788d71f4b67c035515a160ea76d8",
3 "ref": "decreased-spec",
4 "status": "failed",
5 "name": "test",
6 "target_url": null,
7 "description": null,
8 "created_at": "2015-10-23T23:56:49.499+02:00",
9 "started_at": null,
10 "finished_at": "2015-10-23T23:56:49.534+02:00",
11 "author": {
12 "name": "Dominik Sander",
13 "username": "dsander",
14 "id": 1,
15 "state": "active",
16 "avatar_url": "https://secure.gravatar.com/avatar/xxx?s=40&d=identicon",
17 "web_url": "https://github.com/u/dsander"
18 }
19 }
0 [{"id":1,"code":"brute","name":"Brute","description":null,"path":"brute","default_branch":null,"owner":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"private":true,"issues_enabled":true,"merge_requests_enabled":true,"wall_enabled":true,"wiki_enabled":true,"created_at":"2012-09-17T09:41:56Z"},{"id":2,"code":"mozart","name":"Mozart","description":null,"path":"mozart","default_branch":null,"owner":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"private":true,"issues_enabled":true,"merge_requests_enabled":true,"wall_enabled":true,"wiki_enabled":true,"created_at":"2012-09-17T09:41:57Z"},{"id":3,"code":"gitlab","name":"Gitlab","description":null,"path":"gitlab","default_branch":null,"owner":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"private":true,"issues_enabled":true,"merge_requests_enabled":true,"wall_enabled":true,"wiki_enabled":true,"created_at":"2012-09-17T09:41:58Z"}]
0 {"id": 1, "project_id": 1, "created_at": "2016-05-25T20:27:15.545Z", "commit_message_regex": "\\b[A-Z]{3}-[0-9]+\\b", "deny_delete_tag": false}
0 source 'https://rubygems.org'
1 gem 'rails', '4.1.2'
0 {"tag_name":"0.0.1","description":"Amazing release. Wow"}
0 {"tag_name":"0.0.1","description":"Amazing release. Wow"}
0 {"file_path":"path","branch_name":"branch","encoding":"base64","content":"Y29udGVudA==","commit_message":"commit message"}
0 {"id":8,"variables":{"a":"10"}}
0 {
1 "active": true,
2 "architecture": null,
3 "description": "test-1-20150125",
4 "id": 6,
5 "is_shared": false,
6 "contacted_at": "2016-01-25T16:39:48.066Z",
7 "name": null,
8 "platform": null,
9 "projects": [
10 {
11 "id": 1,
12 "name": "GitLab Community Edition",
13 "name_with_namespace": "GitLab.org / GitLab Community Edition",
14 "path": "gitlab-ce",
15 "path_with_namespace": "gitlab-org/gitlab-ce"
16 }
17 ],
18 "token": "205086a8e3b9a2b818ffac9b89d102",
19 "revision": null,
20 "tag_list": [
21 "ruby",
22 "mysql"
23 ],
24 "version": null
25 }
0 {
1 "active": true,
2 "description": "test-1-20150125-test",
3 "id": 6,
4 "is_shared": false,
5 "name": null
6 }
0 {
1 "active": true,
2 "architecture": null,
3 "description": "abcefg",
4 "id": 6,
5 "is_shared": false,
6 "contacted_at": "2016-01-25T16:39:48.066Z",
7 "name": null,
8 "platform": null,
9 "projects": [
10 {
11 "id": 1,
12 "name": "GitLab Community Edition",
13 "name_with_namespace": "GitLab.org / GitLab Community Edition",
14 "path": "gitlab-ce",
15 "path_with_namespace": "gitlab-org/gitlab-ce"
16 }
17 ],
18 "token": "205086a8e3b9a2b818ffac9b89d102",
19 "revision": null,
20 "tag_list": [
21 "ruby",
22 "mysql"
23 ],
24 "version": null
25 }
0 [
1 {
2 "id": 2,
3 "status": "running",
4 "stage": "test",
5 "name": "test",
6 "ref": "master",
7 "tag": false,
8 "coverage": null,
9 "created_at": "2017-11-16T08:50:29.000Z",
10 "started_at": "2017-11-16T08:51:29.000Z",
11 "finished_at": "2017-11-16T08:53:29.000Z",
12 "duration": 120,
13 "user": {
14 "id": 1,
15 "name": "John Doe2",
16 "username": "user2",
17 "state": "active",
18 "avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
19 "web_url": "http://localhost/user2",
20 "created_at": "2017-11-16T18:38:46.000Z",
21 "bio": null,
22 "location": null,
23 "skype": "",
24 "linkedin": "",
25 "twitter": "",
26 "website_url": "",
27 "organization": null
28 },
29 "commit": {
30 "id": "97de212e80737a608d939f648d959671fb0a0142",
31 "short_id": "97de212e",
32 "title": "Update configuration\r",
33 "created_at": "2017-11-16T08:50:28.000Z",
34 "parent_ids": [
35 "1b12f15a11fc6e62177bef08f47bc7b5ce50b141",
36 "498214de67004b1da3d820901307bed2a68a8ef6"
37 ],
38 "message": "See merge request !123",
39 "author_name": "John Doe2",
40 "author_email": "user2@example.org",
41 "authored_date": "2017-11-16T08:50:27.000Z",
42 "committer_name": "John Doe2",
43 "committer_email": "user2@example.org",
44 "committed_date": "2017-11-16T08:50:27.000Z"
45 },
46 "pipeline": {
47 "id": 2,
48 "sha": "97de212e80737a608d939f648d959671fb0a0142",
49 "ref": "master",
50 "status": "running"
51 },
52 "project": {
53 "id": 1,
54 "description": null,
55 "name": "project1",
56 "name_with_namespace": "John Doe2 / project1",
57 "path": "project1",
58 "path_with_namespace": "namespace1/project1",
59 "created_at": "2017-11-16T18:38:46.620Z"
60 }
61 }
62 ]
0 [
1 {
2 "active": true,
3 "description": "test-1-20150125",
4 "id": 6,
5 "is_shared": false,
6 "name": null
7 },
8 {
9 "active": true,
10 "description": "test-2-20150125",
11 "id": 8,
12 "is_shared": false,
13 "name": null
14 }
15 ]
0 [
1 {
2 "active": true,
3 "description": "shared-runner-1",
4 "id": 1,
5 "is_shared": true,
6 "name": null
7 },
8 {
9 "active": true,
10 "description": "shared-runner-2",
11 "id": 3,
12 "is_shared": true,
13 "name": null
14 },
15 {
16 "active": true,
17 "description": "test-1-20150125",
18 "id": 6,
19 "is_shared": false,
20 "name": null
21 },
22 {
23 "active": true,
24 "description": "test-2-20150125",
25 "id": 8,
26 "is_shared": false,
27 "name": null
28 }
29 ]
0 {"id":38,"title":"Redmine","created_at":"2015-12-18T14:17:17.592+03:00","updated_at":"2015-12-18T17:55:09.594+03:00","active":true,"push_events":true,"issues_events":true,"merge_requests_events":true,"tag_push_events":true,"note_events":true,"build_events":false,"properties":{"description":"Redmine","project_url":"https://example.com/projects/test_project/issue","issues_url":"https://example.com/issues/:id","new_issue_url":"'https://example.com/projects/test_project/issues/new"}}
0 {"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z","private_token":"qEsq1pt6HJPaNciie3MG"}
0 party on, dudes
1 be excellent to each other
0 {
1 "queues": {
2 "default": {
3 "backlog": 0,
4 "latency": 0
5 }
6 },
7 "processes": [
8 {
9 "hostname": "gitlab.example.com",
10 "pid": 5649,
11 "tag": "gitlab",
12 "started_at": "2016-06-14T10:45:07.159-05:00",
13 "queues": [
14 "post_receive",
15 "mailers",
16 "archive_repo",
17 "system_hook",
18 "project_web_hook",
19 "gitlab_shell",
20 "incoming_email",
21 "runner",
22 "common",
23 "default"
24 ],
25 "labels": [],
26 "concurrency": 25,
27 "busy": 0
28 }
29 ],
30 "jobs": {
31 "processed": 2,
32 "failed": 0,
33 "enqueued": 0
34 }
35 }
0 {
1 "jobs": {
2 "processed": 2,
3 "failed": 0,
4 "enqueued": 0
5 }
6 }
0 {
1 "processes": [
2 {
3 "hostname": "gitlab.example.com",
4 "pid": 5649,
5 "tag": "gitlab",
6 "started_at": "2016-06-14T10:45:07.159-05:00",
7 "queues": [
8 "post_receive",
9 "mailers",
10 "archive_repo",
11 "system_hook",
12 "project_web_hook",
13 "gitlab_shell",
14 "incoming_email",
15 "runner",
16 "common",
17 "default"
18 ],
19 "labels": [],
20 "concurrency": 25,
21 "busy": 0
22 }
23 ]
24 }
0 {
1 "queues": {
2 "default": {
3 "backlog": 0,
4 "latency": 0
5 }
6 }
7 }
0 {"id":1,"title":"Rails Console ActionMailer","file_name":"mailer_test.rb","author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"expires_at":"2012-09-24T00:00:00Z","updated_at":"2012-09-17T09:51:42Z","created_at":"2012-09-17T09:51:42Z"}
0 {
1 "id": 4,
2 "name": "blowfish",
3 "user": {
4 "name": "Administrator",
5 "username": "root",
6 "id": 1,
7 "state": "active",
8 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
9 "web_url": "http://gitlab.example.com/root"
10 },
11 "created_at": "2016-06-15T10:09:34.206Z",
12 "updated_at": "2016-06-15T10:09:34.206Z",
13 "awardable_id": 80,
14 "awardable_type": "Snippet"
15 }
0 [
1 {
2 "id": 4,
3 "name": "1234",
4 "user": {
5 "name": "Administrator",
6 "username": "root",
7 "id": 1,
8 "state": "active",
9 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
10 "web_url": "http://gitlab.example.com/root"
11 },
12 "created_at": "2016-06-15T10:09:34.206Z",
13 "updated_at": "2016-06-15T10:09:34.206Z",
14 "awardable_id": 80,
15 "awardable_type": "Snippet"
16 },
17 {
18 "id": 1,
19 "name": "microphone",
20 "user": {
21 "name": "User 4",
22 "username": "user4",
23 "id": 26,
24 "state": "active",
25 "avatar_url": "http://www.gravatar.com/avatar/7e65550957227bd38fe2d7fbc6fd2f7b?s=80&d=identicon",
26 "web_url": "http://gitlab.example.com/user4"
27 },
28 "created_at": "2016-06-15T10:09:34.177Z",
29 "updated_at": "2016-06-15T10:09:34.177Z",
30 "awardable_id": 80,
31 "awardable_type": "Snippet"
32 }
33 ]
0 #!/usr/bin/env ruby
1
2 puts "Cool snippet!"
0 [{"id":1,"title":"Rails Console ActionMailer","file_name":"mailer_test.rb","author":{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z"},"expires_at":"2012-09-24T00:00:00Z","updated_at":"2012-09-17T09:51:42Z","created_at":"2012-09-17T09:51:42Z"}]
0 {"id": 3, "url": "http://example.com/hook", "created_at": "2013-10-02T10:15:31Z"}
0 [{"id": 3, "url": "http://example.com/hook", "created_at": "2013-10-02T10:15:31Z"}]
0 {"name":"0.0.1","message":null,"commit":{"id":"c260c39f4d73d9087482d29b4d7a88bec834a3d1","message":"rubocop 100%","parent_ids":["b55be4dc5c052fb0058ef1ea96acd5e4e37f1bed"],"authored_date":"2016-04-29T16:11:32.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-04-29T16:11:32.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null}
0 {"name":"0.0.1","message":"this tag is annotated","commit":{"id":"3d3f9288d70f75aa55ea495a3ed5948a628fce11","message":"Added README.md\n","parent_ids":[],"authored_date":"2016-05-25T11:23:07.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-05-25T11:23:07.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":{"tag_name":"0.0.1","description":"and it has release notes"}}
0 {"name":"0.0.1","message":"this tag is annotated","commit":{"id":"7225ddbe28add8d168e3175266830ab8e6aabdcc","message":"Readme updated","parent_ids":["c3f101968138aa9b09a92c8b6399b3269d17865e"],"authored_date":"2016-03-07T13:38:07.000+00:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-03-07T13:38:07.000+00:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null}
0 {"tag_name":"0.0.1"}
0 [{"name":"0.0.2","message":null,"commit":{"id":"c260c39f4d73d9087482d29b4d7a88bec834a3d1","message":"rubocop 100%","parent_ids":["b55be4dc5c052fb0058ef1ea96acd5e4e37f1bed"],"authored_date":"2016-04-29T16:11:32.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-04-29T16:11:32.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null},{"name":"0.0.1","message":null,"commit":{"id":"c260c39f4d73d9087482d29b4d7a88bec834a3d1","message":"rubocop 100%","parent_ids":["b55be4dc5c052fb0058ef1ea96acd5e4e37f1bed"],"authored_date":"2016-04-29T16:11:32.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-04-29T16:11:32.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null}]
0 {"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z","access_level":40}
0 [{"id":1,"email":"john@example.com","name":"John Smith","blocked":false,"created_at":"2012-09-17T09:41:56Z","access_level":40},{"id":2,"email":"jack@example.com","name":"Jack Smith","blocked":false,"created_at":"2012-09-17T09:42:03Z","access_level":20},{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","blocked":false,"created_at":"2012-09-17T09:42:03Z","access_level":40},{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","blocked":false,"created_at":"2012-09-17T09:42:03Z","access_level":40},{"id":6,"email":"faye.watsica@rohanwalter.com","name":"Ambrose Hansen","blocked":false,"created_at":"2012-09-17T09:42:03Z","access_level":40},{"id":7,"email":"maida@walshtorp.name","name":"Alana Hahn","blocked":false,"created_at":"2012-09-17T09:42:03Z","access_level":20}]
0 {
1 "id": 102,
2 "project": {
3 "id": 2,
4 "name": "Gitlab Ce",
5 "name_with_namespace": "Gitlab Org / Gitlab Ce",
6 "path": "gitlab-ce",
7 "path_with_namespace": "gitlab-org/gitlab-ce"
8 },
9 "author": {
10 "name": "Administrator",
11 "username": "root",
12 "id": 1,
13 "state": "active",
14 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
15 "web_url": "https://gitlab.example.com/root"
16 },
17 "action_name": "marked",
18 "target_type": "MergeRequest",
19 "target": {
20 "id": 34,
21 "iid": 7,
22 "project_id": 2,
23 "title": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
24 "description": "Et ea et omnis illum cupiditate. Dolor aspernatur tenetur ducimus facilis est nihil. Quo esse cupiditate molestiae illo corrupti qui quidem dolor.",
25 "state": "opened",
26 "created_at": "2016-06-17T07:49:24.419Z",
27 "updated_at": "2016-06-17T07:52:43.484Z",
28 "target_branch": "tutorials_git_tricks",
29 "source_branch": "DNSBL_docs",
30 "upvotes": 0,
31 "downvotes": 0,
32 "author": {
33 "name": "Maxie Medhurst",
34 "username": "craig_rutherford",
35 "id": 12,
36 "state": "active",
37 "avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
38 "web_url": "https://gitlab.example.com/craig_rutherford"
39 },
40 "assignee": {
41 "name": "Administrator",
42 "username": "root",
43 "id": 1,
44 "state": "active",
45 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
46 "web_url": "https://gitlab.example.com/root"
47 },
48 "source_project_id": 2,
49 "target_project_id": 2,
50 "labels": [],
51 "work_in_progress": false,
52 "milestone": {
53 "id": 32,
54 "iid": 2,
55 "project_id": 2,
56 "title": "v1.0",
57 "description": "Assumenda placeat ea voluptatem voluptate qui.",
58 "state": "active",
59 "created_at": "2016-06-17T07:47:34.163Z",
60 "updated_at": "2016-06-17T07:47:34.163Z",
61 "due_date": null
62 },
63 "merge_when_pipeline_succeeds": false,
64 "merge_status": "cannot_be_merged",
65 "subscribed": true,
66 "user_notes_count": 7
67 },
68 "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ce/merge_requests/7",
69 "body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
70 "state": "done",
71 "created_at": "2016-06-17T07:52:35.225Z"
72 }
0 [
1 {
2 "id": 102,
3 "project": {
4 "id": 2,
5 "name": "Gitlab Ce",
6 "name_with_namespace": "Gitlab Org / Gitlab Ce",
7 "path": "gitlab-ce",
8 "path_with_namespace": "gitlab-org/gitlab-ce"
9 },
10 "author": {
11 "name": "Administrator",
12 "username": "root",
13 "id": 1,
14 "state": "active",
15 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
16 "web_url": "https://gitlab.example.com/root"
17 },
18 "action_name": "marked",
19 "target_type": "MergeRequest",
20 "target": {
21 "id": 34,
22 "iid": 7,
23 "project_id": 2,
24 "title": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
25 "description": "Et ea et omnis illum cupiditate. Dolor aspernatur tenetur ducimus facilis est nihil. Quo esse cupiditate molestiae illo corrupti qui quidem dolor.",
26 "state": "opened",
27 "created_at": "2016-06-17T07:49:24.419Z",
28 "updated_at": "2016-06-17T07:52:43.484Z",
29 "target_branch": "tutorials_git_tricks",
30 "source_branch": "DNSBL_docs",
31 "upvotes": 0,
32 "downvotes": 0,
33 "author": {
34 "name": "Maxie Medhurst",
35 "username": "craig_rutherford",
36 "id": 12,
37 "state": "active",
38 "avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
39 "web_url": "https://gitlab.example.com/craig_rutherford"
40 },
41 "assignee": {
42 "name": "Administrator",
43 "username": "root",
44 "id": 1,
45 "state": "active",
46 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
47 "web_url": "https://gitlab.example.com/root"
48 },
49 "source_project_id": 2,
50 "target_project_id": 2,
51 "labels": [],
52 "work_in_progress": false,
53 "milestone": {
54 "id": 32,
55 "iid": 2,
56 "project_id": 2,
57 "title": "v1.0",
58 "description": "Assumenda placeat ea voluptatem voluptate qui.",
59 "state": "active",
60 "created_at": "2016-06-17T07:47:34.163Z",
61 "updated_at": "2016-06-17T07:47:34.163Z",
62 "due_date": null
63 },
64 "merge_when_pipeline_succeeds": false,
65 "merge_status": "cannot_be_merged",
66 "subscribed": true,
67 "user_notes_count": 7
68 },
69 "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ce/merge_requests/7",
70 "body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
71 "state": "pending",
72 "created_at": "2016-06-17T07:52:35.225Z"
73 },
74 {
75 "id": 98,
76 "project": {
77 "id": 2,
78 "name": "Gitlab Ce",
79 "name_with_namespace": "Gitlab Org / Gitlab Ce",
80 "path": "gitlab-ce",
81 "path_with_namespace": "gitlab-org/gitlab-ce"
82 },
83 "author": {
84 "name": "Maxie Medhurst",
85 "username": "craig_rutherford",
86 "id": 12,
87 "state": "active",
88 "avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
89 "web_url": "https://gitlab.example.com/craig_rutherford"
90 },
91 "action_name": "assigned",
92 "target_type": "MergeRequest",
93 "target": {
94 "id": 34,
95 "iid": 7,
96 "project_id": 2,
97 "title": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
98 "description": "Et ea et omnis illum cupiditate. Dolor aspernatur tenetur ducimus facilis est nihil. Quo esse cupiditate molestiae illo corrupti qui quidem dolor.",
99 "state": "opened",
100 "created_at": "2016-06-17T07:49:24.419Z",
101 "updated_at": "2016-06-17T07:52:43.484Z",
102 "target_branch": "tutorials_git_tricks",
103 "source_branch": "DNSBL_docs",
104 "upvotes": 0,
105 "downvotes": 0,
106 "author": {
107 "name": "Maxie Medhurst",
108 "username": "craig_rutherford",
109 "id": 12,
110 "state": "active",
111 "avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
112 "web_url": "https://gitlab.example.com/craig_rutherford"
113 },
114 "assignee": {
115 "name": "Administrator",
116 "username": "root",
117 "id": 1,
118 "state": "active",
119 "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
120 "web_url": "https://gitlab.example.com/root"
121 },
122 "source_project_id": 2,
123 "target_project_id": 2,
124 "labels": [],
125 "work_in_progress": false,
126 "milestone": {
127 "id": 32,
128 "iid": 2,
129 "project_id": 2,
130 "title": "v1.0",
131 "description": "Assumenda placeat ea voluptatem voluptate qui.",
132 "state": "active",
133 "created_at": "2016-06-17T07:47:34.163Z",
134 "updated_at": "2016-06-17T07:47:34.163Z",
135 "due_date": null
136 },
137 "merge_when_pipeline_succeeds": false,
138 "merge_status": "cannot_be_merged",
139 "subscribed": true,
140 "user_notes_count": 7
141 },
142 "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ce/merge_requests/7",
143 "body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
144 "state": "pending",
145 "created_at": "2016-06-17T07:49:24.624Z"
146 }
147 ]
0 [{"id":"a2cc3b0ffc1c7d06fab5642eb99ea387b57f22f8","name":"app","type":"tree","mode":"040000"},{"id":"63164bdfbc11b69f1032fbe35da0f1e9c18af2fd","name":"bin","type":"tree","mode":"040000"},{"id":"2cf682191722f20f00a371d7da58f6a35701c11d","name":"config","type":"tree","mode":"040000"},{"id":"2e76c8c1bbc46bcc762788a432d802d65a534a28","name":"db","type":"tree","mode":"040000"},{"id":"767cfc8360b50c50bb5bdde288b96a84e3efa66e","name":"doc","type":"tree","mode":"040000"},{"id":"3fa0d1024f5e372bf9e43d1dac47bd1e95ab0858","name":"lib","type":"tree","mode":"040000"},{"id":"4e79d0ac6225844602a1b9273b26d8996f777bf2","name":"log","type":"tree","mode":"040000"},{"id":"7cb7f593c6914d20fa6cc4ab5a7c34337a50e97c","name":"public","type":"tree","mode":"040000"},{"id":"d97169eef778f3cd1d4d94cbe3415b3166d15c71","name":"spec","type":"tree","mode":"040000"},{"id":"97c97da29fa97e2158cfdcdcb042af9da0bc3de4","name":"vendor","type":"tree","mode":"040000"},{"id":"d316760e4746059c117007507594a1d75b47df38","name":".gitignore","type":"blob","mode":"100644"},{"id":"f2e7cd477536f18d8e939faf452930b59a27063d","name":".travis.yml","type":"blob","mode":"100644"},{"id":"d5c68bda5f0fe703a80906f66cfe537ca807a5a6","name":"Capfile","type":"blob","mode":"100644"},{"id":"8f46eac03c6cd7ce03cda7ec3d78afdc6971e4c0","name":"Gemfile","type":"blob","mode":"100644"},{"id":"5e260573173b51eaa073661d7914fb0e935ee27f","name":"Gemfile.lock","type":"blob","mode":"100644"},{"id":"e57032f682b69f14243c09d66a0892a03b4c6045","name":"Procfile","type":"blob","mode":"100644"},{"id":"905e96da839dad683dfcf4e202bf1e030390b964","name":"README.md","type":"blob","mode":"100644"},{"id":"24a16769fd94926350a59f7b1cbd78e9e2674c57","name":"Rakefile","type":"blob","mode":"100644"},{"id":"b384d6d57c6a775a9b6bc35d79ad7f03e673a233","name":"config.ru","type":"blob","mode":"100644"}]
0 {
1 "id": 10,
2 "description": "my trigger",
3 "created_at": "2016-01-07T09:53:58.235Z",
4 "deleted_at": null,
5 "last_used": null,
6 "token": "6d056f63e50fe6f8c5f8f4aa10edb7",
7 "updated_at": "2016-01-07T09:53:58.235Z",
8 "owner": null
9 }
0 [
1 {
2 "id": 10,
3 "description": "my trigger",
4 "created_at": "2016-01-07T09:53:58.235Z",
5 "deleted_at": null,
6 "last_used": null,
7 "token": "6d056f63e50fe6f8c5f8f4aa10edb7",
8 "updated_at": "2016-01-07T09:53:58.235Z",
9 "owner": null
10 }
11 ]
0 {"id":1,"email":"john@example.com","name":"John Smith","username":"john.smith","bio":null,"skype":"","linkedin":"","twitter":"john","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"}
0 [
1 {
2 "title": null,
3 "project_id": 15,
4 "action_name": "closed",
5 "target_id": 830,
6 "target_type": "Issue",
7 "author_id": 1,
8 "target_title": "Public project search field",
9 "author": {
10 "name": "Dmitriy Zaporozhets",
11 "username": "root",
12 "id": 1,
13 "state": "active",
14 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
15 "web_url": "http://localhost:3000/root"
16 },
17 "author_username": "root"
18 },
19 {
20 "title": null,
21 "project_id": 15,
22 "action_name": "pushed",
23 "target_id": null,
24 "target_type": null,
25 "author_id": 1,
26 "author": {
27 "name": "Dmitriy Zaporozhets",
28 "username": "root",
29 "id": 1,
30 "state": "active",
31 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
32 "web_url": "http://localhost:3000/root"
33 },
34 "author_username": "john",
35 "push_data": {
36 "commit_count": 1,
37 "action": "pushed",
38 "ref_type": "branch",
39 "commit_from": "50d4420237a9de7be1304607147aec22e4a14af7",
40 "commit_to": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
41 "ref": "master",
42 "commit_title": "Add simple search to projects in public area"
43 },
44 "target_title": null
45 },
46 {
47 "title": null,
48 "project_id": 15,
49 "action_name": "closed",
50 "target_id": 840,
51 "target_type": "Issue",
52 "author_id": 1,
53 "target_title": "Finish & merge Code search PR",
54 "author": {
55 "name": "Dmitriy Zaporozhets",
56 "username": "root",
57 "id": 1,
58 "state": "active",
59 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
60 "web_url": "http://localhost:3000/root"
61 },
62 "author_username": "root"
63 },
64 {
65 "title": null,
66 "project_id": 15,
67 "action_name": "commented on",
68 "target_id": 1312,
69 "target_type": "Note",
70 "author_id": 1,
71 "target_title": null,
72 "created_at": "2015-12-04T10:33:58.089Z",
73 "note": {
74 "id": 1312,
75 "body": "What an awesome day!",
76 "attachment": null,
77 "author": {
78 "name": "Dmitriy Zaporozhets",
79 "username": "root",
80 "id": 1,
81 "state": "active",
82 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
83 "web_url": "http://localhost:3000/root"
84 },
85 "created_at": "2015-12-04T10:33:56.698Z",
86 "system": false,
87 "noteable_id": 377,
88 "noteable_type": "Issue"
89 },
90 "author": {
91 "name": "Dmitriy Zaporozhets",
92 "username": "root",
93 "id": 1,
94 "state": "active",
95 "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
96 "web_url": "http://localhost:3000/root"
97 },
98 "author_username": "root"
99 }
100 ]
0 {"id":1,"email":"email@example.com"}
0 [{"id":1,"email":"email@example.com"},{"id":3,"email":"email2@example.com"}]
0 [
1 {
2 "title":null,
3 "project_id":1,
4 "action_name":"opened",
5 "target_id":160,
6 "target_type":"Issue",
7 "author_id":25,
8 "target_title":"Qui natus eos odio tempore et quaerat consequuntur ducimus cupiditate quis.",
9 "created_at":"2017-02-09T10:43:19.667Z",
10 "author":{
11 "name":"User 3",
12 "username":"user3",
13 "id":25,
14 "state":"active",
15 "avatar_url":"http://www.gravatar.com/avatar/97d6d9441ff85fdc730e02a6068d267b?s=80\u0026d=identicon",
16 "web_url":"https://gitlab.example.com/user3"
17 },
18 "author_username":"user3"
19 },
20 {
21 "title":null,
22 "project_id":1,
23 "action_name":"opened",
24 "target_id":159,
25 "target_type":"Issue",
26 "author_id":21,
27 "target_title":"Nostrum enim non et sed optio illo deleniti non.",
28 "created_at":"2017-02-09T10:43:19.426Z",
29 "author":{
30 "name":"Test User",
31 "username":"ted",
32 "id":21,
33 "state":"active",
34 "avatar_url":"http://www.gravatar.com/avatar/80fb888c9a48b9a3f87477214acaa63f?s=80\u0026d=identicon",
35 "web_url":"https://gitlab.example.com/ted"
36 },
37 "author_username":"ted"
38 }
39 ]
0 [
1 {
2 "id": 1,
3 "description": null,
4 "default_branch": "master",
5 "visibility": "private",
6 "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
7 "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
8 "web_url": "http://example.com/diaspora/diaspora-client",
9 "tag_list": [
10 "example",
11 "disapora client"
12 ],
13 "owner": {
14 "id": 1,
15 "name": "Diaspora",
16 "created_at": "2013-09-30T13:46:02Z"
17 },
18 "name": "Diaspora Client",
19 "name_with_namespace": "Diaspora / Diaspora Client",
20 "path": "diaspora-client",
21 "path_with_namespace": "diaspora/diaspora-client",
22 "issues_enabled": true,
23 "open_issues_count": 1,
24 "merge_requests_enabled": true,
25 "jobs_enabled": true,
26 "wiki_enabled": true,
27 "snippets_enabled": false,
28 "resolve_outdated_diff_discussions": false,
29 "container_registry_enabled": false,
30 "created_at": "2013-09-30T13:46:02Z",
31 "last_activity_at": "2013-09-30T13:46:02Z",
32 "creator_id": 3,
33 "namespace": {
34 "id": 3,
35 "name": "Diaspora",
36 "path": "diaspora",
37 "kind": "group",
38 "full_path": "diaspora"
39 },
40 "import_status": "none",
41 "archived": false,
42 "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
43 "shared_runners_enabled": true,
44 "forks_count": 0,
45 "star_count": 0,
46 "runners_token": "b8547b1dc37721d05889db52fa2f02",
47 "public_jobs": true,
48 "shared_with_groups": [
49
50 ],
51 "only_allow_merge_if_pipeline_succeeds": false,
52 "only_allow_merge_if_all_discussions_are_resolved": false,
53 "request_access_enabled": false,
54 "statistics": {
55 "commit_count": 37,
56 "storage_size": 1038090,
57 "repository_size": 1038090,
58 "lfs_objects_size": 0,
59 "job_artifacts_size": 0
60 },
61 "_links": {
62 "self": "http://example.com/api/v4/projects",
63 "issues": "http://example.com/api/v4/projects/1/issues",
64 "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
65 "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
66 "labels": "http://example.com/api/v4/projects/1/labels",
67 "events": "http://example.com/api/v4/projects/1/events",
68 "members": "http://example.com/api/v4/projects/1/members"
69 }
70 },
71 {
72 "id": 6,
73 "description": null,
74 "default_branch": "master",
75 "visibility": "private",
76 "ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
77 "http_url_to_repo": "http://example.com/brightbox/puppet.git",
78 "web_url": "http://example.com/brightbox/puppet",
79 "tag_list": [
80 "example",
81 "puppet"
82 ],
83 "owner": {
84 "id": 1,
85 "name": "Brightbox",
86 "created_at": "2013-09-30T13:46:02Z"
87 },
88 "name": "Puppet",
89 "name_with_namespace": "Brightbox / Puppet",
90 "path": "puppet",
91 "path_with_namespace": "brightbox/puppet",
92 "issues_enabled": true,
93 "open_issues_count": 1,
94 "merge_requests_enabled": true,
95 "jobs_enabled": true,
96 "wiki_enabled": true,
97 "snippets_enabled": false,
98 "resolve_outdated_diff_discussions": false,
99 "container_registry_enabled": false,
100 "created_at": "2013-09-30T13:46:02Z",
101 "last_activity_at": "2013-09-30T13:46:02Z",
102 "creator_id": 3,
103 "namespace": {
104 "id": 4,
105 "name": "Brightbox",
106 "path": "brightbox",
107 "kind": "group",
108 "full_path": "brightbox"
109 },
110 "import_status": "none",
111 "import_error": null,
112 "permissions": {
113 "project_access": {
114 "access_level": 10,
115 "notification_level": 3
116 },
117 "group_access": {
118 "access_level": 50,
119 "notification_level": 3
120 }
121 },
122 "archived": false,
123 "avatar_url": null,
124 "shared_runners_enabled": true,
125 "forks_count": 0,
126 "star_count": 0,
127 "runners_token": "b8547b1dc37721d05889db52fa2f02",
128 "public_jobs": true,
129 "shared_with_groups": [
130
131 ],
132 "only_allow_merge_if_pipeline_succeeds": false,
133 "only_allow_merge_if_all_discussions_are_resolved": false,
134 "request_access_enabled": false,
135 "statistics": {
136 "commit_count": 12,
137 "storage_size": 2066080,
138 "repository_size": 2066080,
139 "lfs_objects_size": 0,
140 "job_artifacts_size": 0
141 },
142 "_links": {
143 "self": "http://example.com/api/v4/projects",
144 "issues": "http://example.com/api/v4/projects/1/issues",
145 "merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
146 "repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
147 "labels": "http://example.com/api/v4/projects/1/labels",
148 "events": "http://example.com/api/v4/projects/1/events",
149 "members": "http://example.com/api/v4/projects/1/members"
150 }
151 }
152 ]
0 [{"id":1,"email":"john1@example.com","name":"John Smith 1","username":"john.smith1","bio":null,"skype":"","linkedin":"","twitter":"john1","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"},{"id":2,"email":"john2@example.com","name":"John Smith 2","username":"john.smith2","bio":null,"skype":"","linkedin":"","twitter":"john2","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:56Z"}]
0 [{"id":1,"email":"john@example.com","name":"John Smith","username":"john.smith","bio":null,"skype":"","linkedin":"","twitter":"john","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"},{"id":2,"email":"jack@example.com","name":"Jack Smith","username":"jack.smith","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":3,"email":"wilma@mayerblanda.ca","name":"Beatrice Jewess","username":"beatrice.jewess","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":4,"email":"nicole@mertz.com","name":"Felipe Davis","username":"felipe.davis","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":5,"email":"aliza_stark@schmeler.info","name":"Michale Von","username":"michale.von","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":6,"email":"faye.watsica@rohanwalter.com","name":"Ambrose Hansen","username":"ambrose.hansen","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"},{"id":7,"email":"maida@walshtorp.name","name":"Alana Hahn","username":"alana.hahn","bio":null,"skype":"","linkedin":"","twitter":"","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:03Z"}]
0 {
1 "key": "VARIABLE",
2 "value": "the value"
3 }
0 [
1 {
2 "key": "TEST_VARIABLE_1",
3 "value": "TEST_1"
4 },
5 {
6 "key": "TEST_VARIABLE_2",
7 "value": "TEST_2"
8 }
9 ]
0 require 'spec_helper'
1
2 describe Gitlab::API do
3 let(:default_headers) { subject.class.default_options[:headers] }
4
5 describe ".default_options[:headers]" do
6 it "has 'User-Agent'" do
7 expect(default_headers).to include('User-Agent' => Gitlab::Configuration::DEFAULT_USER_AGENT)
8 end
9 end
10 end
0 require 'spec_helper'
1
2 describe Gitlab::CLI::Helpers do
3 describe ".method_owners" do
4 let(:methods) { Gitlab::CLI::Helpers.method_owners }
5
6 it "returns Array of Hashes containing method names and owners" do
7 expect(methods).to be_a Array
8 expect(methods.all? { |m| m.is_a? Hash }).to be true
9 expect(methods.all? { |m| m.keys.sort == %i(name owner) }).to be true
10 end
11 end
12
13 describe ".valid_command?" do
14 it "returns true when command is valid" do
15 expect(Gitlab::CLI::Helpers.valid_command?('merge_requests')).to be_truthy
16 end
17 it "returns false when command is NOT valid" do
18 expect(Gitlab::CLI::Helpers.valid_command?('mmmmmerge_requests')).to be_falsy
19 end
20 end
21
22 describe ".symbolize_keys" do
23 context "when input is a Hash" do
24 it "returns a Hash with symbols for keys" do
25 hash = { 'key1' => 'val1', 'key2' => 'val2' }
26 symbolized_hash = Gitlab::CLI::Helpers.symbolize_keys(hash)
27 expect(symbolized_hash).to eq(key1: 'val1', key2: 'val2')
28 end
29 end
30 context "when input is NOT a Hash" do
31 it "returns input untouched" do
32 array = [1, 2, 3]
33 new_array = Gitlab::CLI::Helpers.symbolize_keys(array)
34 expect(new_array).to eq([1, 2, 3])
35 end
36 end
37 end
38
39 describe ".yaml_load" do
40 context "when argument is a YAML string" do
41 it "returns Ruby objects" do
42 argument = "{foo: bar, sna: fu}"
43 output = Gitlab::CLI::Helpers.yaml_load argument
44 expect(output).to eq('foo' => 'bar', 'sna' => 'fu')
45 end
46 end
47
48 context "when input is NOT valid YAML" do
49 it "raises a TypeError" do
50 ruby_array = [1, 2, 3, 4]
51 expect { Gitlab::CLI::Helpers.yaml_load ruby_array }.to raise_error TypeError
52 end
53 end
54 end
55 end
0 require 'spec_helper'
1 require 'json'
2
3 describe Gitlab::CLI do
4 describe ".run" do
5 context "when command is version" do
6 it "shows gem version" do
7 output = capture_output { Gitlab::CLI.run('-v') }
8 expect(output).to eq("Gitlab Ruby Gem #{Gitlab::VERSION}\n")
9 end
10 end
11
12 context "when command is info" do
13 it "shows environment info" do
14 output = capture_output { Gitlab::CLI.run('info') }
15 expect(output).to include("Gitlab endpoint is")
16 expect(output).to include("Gitlab private token is")
17 expect(output).to include("Ruby Version is")
18 expect(output).to include("Gitlab Ruby Gem")
19 end
20 end
21
22 context "when command is help" do
23 it "shows available actions" do
24 output = capture_output { Gitlab::CLI.run('help') }
25 expect(output).to include('Help Topics')
26 expect(output).to include('MergeRequests')
27 end
28 end
29
30 context "when command is user" do
31 before do
32 stub_get("/user", "user")
33 @output = capture_output { Gitlab::CLI.run('user') }
34 end
35
36 it "shows executed command" do
37 expect(@output).to include('Gitlab.user')
38 end
39
40 it "shows user data" do
41 expect(@output).to include('name')
42 expect(@output).to include('John Smith')
43 end
44 end
45
46 context "when command is users" do
47 before do
48 stub_get("/users", "users")
49 @output = capture_output { Gitlab::CLI.run('users') }
50 end
51
52 it "shows executed command" do
53 expect(@output).to include('Gitlab.users')
54 end
55
56 it "shows users data" do
57 expect(@output).to include('name')
58 expect(@output).to include('John Smith')
59 expect(@output).to include('Jack Smith')
60 end
61 end
62 end
63
64 describe ".start" do
65 context "when command with excluded fields" do
66 before do
67 stub_get("/user", "user")
68 args = ['user', '--except=id,email,name']
69 @output = capture_output { Gitlab::CLI.start(args) }
70 end
71
72 it "shows user data with excluded fields" do
73 expect(@output).to_not include('John Smith')
74 expect(@output).to include('bio')
75 expect(@output).to include('created_at')
76 end
77 end
78
79 context "when command with json output" do
80 before do
81 stub_get("/user", "user")
82 args = ['user', '--json']
83 @output = capture_output { Gitlab::CLI.start(args) }
84 end
85
86 it "renders output as json" do
87 expect(JSON.parse(@output)['result']).to eq(JSON.parse(File.read(File.dirname(__FILE__) + '/../fixtures/user.json')))
88 expect(JSON.parse(@output)['cmd']).to eq('Gitlab.user')
89 end
90 end
91
92 context "when command with required fields" do
93 before do
94 stub_get("/user", "user")
95 args = ['user', '--only=id,email,name']
96 @output = capture_output { Gitlab::CLI.start(args) }
97 end
98
99 it "shows user data with required fields" do
100 expect(@output).to include('id')
101 expect(@output).to include('name')
102 expect(@output).to include('email')
103 expect(@output).to include('John Smith')
104 expect(@output).to_not include('bio')
105 expect(@output).to_not include('created_at')
106 end
107 end
108
109 context "fetch project with namespace/repo" do
110 it "encodes delimiter" do
111 stub_get("/projects/gitlab-org%2Fgitlab-ce", "project")
112 args = ['project', 'gitlab-org/gitlab-ce']
113 @output = capture_output { Gitlab::CLI.start(args) }
114 expect(@output).to include('id')
115 end
116 end
117 end
118 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe '.project_access_requests' do
4 before do
5 stub_get("/projects/1/access_requests", "access_requests")
6 @access_requests = Gitlab.project_access_requests(1)
7 end
8
9 it 'gets the correct resources' do
10 expect(a_get("/projects/1/access_requests")).to have_been_made
11 end
12
13 it 'returns a paginated response of project access requests' do
14 expect(@access_requests).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe '.group_access_requests' do
19 before do
20 stub_get("/groups/1/access_requests", "access_requests")
21 @access_requests = Gitlab.group_access_requests(1)
22 end
23
24 it 'gets the correct resources' do
25 expect(a_get("/groups/1/access_requests")).to have_been_made
26 end
27
28 it 'returns a paginated response of group access requests' do
29 expect(@access_requests).to be_a Gitlab::PaginatedResponse
30 end
31 end
32
33 describe '.request_project_access' do
34 before do
35 stub_post("/projects/1/access_requests", "access_request")
36 @access_request = Gitlab.request_project_access(1)
37 end
38
39 it 'gets the correct resource' do
40 expect(a_post("/projects/1/access_requests")).to have_been_made
41 end
42 end
43
44 describe '.request_group_access' do
45 before do
46 stub_post("/groups/1/access_requests", "access_request")
47 @access_request = Gitlab.request_group_access(1)
48 end
49
50 it 'gets the correct resource' do
51 expect(a_post("/groups/1/access_requests")).to have_been_made
52 end
53 end
54
55 describe '.approve_project_access_request' do
56 context 'When no access level is given' do
57 before do
58 stub_put("/projects/1/access_requests/1/approve", "default_approved_access_request")
59 @access_request = Gitlab.approve_project_access_request(1, 1)
60 end
61
62 it 'gets the correct resource' do
63 expect(a_put("/projects/1/access_requests/1/approve")).to have_been_made
64 end
65
66 it "returns information about the project access request" do
67 expect(@access_request.access_level).to eq(30)
68 end
69 end
70 context 'When access level is given' do
71 before do
72 stub_put("/projects/1/access_requests/1/approve", "approved_access_request").with(body: {access_level: '20'})
73 @access_request = Gitlab.approve_project_access_request(1, 1, {access_level: '20'})
74 end
75
76 it 'gets the correct resource' do
77 expect(a_put("/projects/1/access_requests/1/approve").
78 with(body: { access_level: "20" })).to have_been_made
79 end
80
81 it "returns information about the project access request" do
82 expect(@access_request.access_level).to eq(20)
83 end
84 end
85 end
86
87 describe '.approve_group_access_request' do
88 context 'When no access level is given' do
89 before do
90 stub_put("/groups/1/access_requests/1/approve", "default_approved_access_request")
91 @access_request = Gitlab.approve_group_access_request(1, 1)
92 end
93
94 it 'gets the correct resource' do
95 expect(a_put("/groups/1/access_requests/1/approve")).to have_been_made
96 end
97
98 it "returns information about the group access request" do
99 expect(@access_request.access_level).to eq(30)
100 end
101 end
102 context 'When access level is given' do
103 before do
104 stub_put("/groups/1/access_requests/1/approve", "approved_access_request").with(body: {access_level: '20'})
105 @access_request = Gitlab.approve_group_access_request(1, 1, {access_level: '20'})
106 end
107
108 it 'gets the correct resource' do
109 expect(a_put("/groups/1/access_requests/1/approve").
110 with(body: { access_level: "20" })).to have_been_made
111 end
112
113 it "returns information about the group access request" do
114 expect(@access_request.access_level).to eq(20)
115 end
116 end
117 end
118
119 describe '.deny_project_access_request' do
120 before do
121 stub_delete("/projects/1/access_requests/1", "access_request")
122 @access_request = Gitlab.deny_project_access_request(1, 1)
123 end
124
125 it 'gets the correct resource' do
126 expect(a_delete("/projects/1/access_requests/1")).to have_been_made
127 end
128 end
129
130 describe '.deny_group_access_request' do
131 before do
132 stub_delete("/groups/1/access_requests/1", "access_request")
133 @access_request = Gitlab.deny_group_access_request(1, 1)
134 end
135
136 it 'gets the correct resource' do
137 expect(a_delete("/groups/1/access_requests/1")).to have_been_made
138 end
139 end
140 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe '.award_emojis' do
4 context 'when issue award emojis' do
5 before do
6 stub_get("/projects/1/issues/80/award_emoji", "issue_award_emojis")
7 @emojis = Gitlab.award_emojis(1, 80, 'issue')
8 end
9
10 it "gets the correct resources" do
11 expect(a_get("/projects/1/issues/80/award_emoji")).to have_been_made
12 end
13
14 it "returns a paginated response of issue award emojis" do
15 expect(@emojis).to be_a Gitlab::PaginatedResponse
16 expect(@emojis.first.awardable_id).to eq(80)
17 expect(@emojis.first.awardable_type).to eq("Issue")
18 end
19 end
20
21 context 'when merge request award emojis' do
22 before do
23 stub_get("/projects/1/merge_requests/80/award_emoji", "merge_request_award_emojis")
24 @emojis = Gitlab.award_emojis(1, 80, 'merge_request')
25 end
26
27 it "gets the correct resources" do
28 expect(a_get("/projects/1/merge_requests/80/award_emoji")).to have_been_made
29 end
30
31 it "returns a paginated response of merge request award emojis" do
32 expect(@emojis).to be_a Gitlab::PaginatedResponse
33 expect(@emojis.first.awardable_id).to eq(80)
34 expect(@emojis.first.awardable_type).to eq("MergeRequest")
35 end
36 end
37
38 context 'when snippet award emojis' do
39 before do
40 stub_get("/projects/1/snippets/80/award_emoji", "snippet_award_emojis")
41 @emojis = Gitlab.award_emojis(1, 80, 'snippet')
42 end
43
44 it "gets the correct resources" do
45 expect(a_get("/projects/1/snippets/80/award_emoji")).to have_been_made
46 end
47
48 it "returns a paginated response of snippet award emojis" do
49 expect(@emojis).to be_a Gitlab::PaginatedResponse
50 expect(@emojis.first.awardable_id).to eq(80)
51 expect(@emojis.first.awardable_type).to eq("Snippet")
52 end
53 end
54 end
55
56 describe '.note_award_emojis' do
57 context 'when issue note award emojis' do
58 before do
59 stub_get("/projects/1/issues/80/notes/1/award_emoji", "note_award_emojis")
60 @note_emojis = Gitlab.note_award_emojis(1, 80, 'issue', 1)
61 end
62
63 it "gets the correct resources" do
64 expect(a_get("/projects/1/issues/80/notes/1/award_emoji")).to have_been_made
65 end
66
67 it "returns a paginated response of issue note award emojis" do
68 expect(@note_emojis).to be_a Gitlab::PaginatedResponse
69 expect(@note_emojis.first.awardable_id).to eq(1)
70 expect(@note_emojis.first.awardable_type).to eq("Note")
71 end
72 end
73
74 context 'when merge request note award emojis' do
75 before do
76 stub_get("/projects/1/merge_requests/80/notes/1/award_emoji", "note_award_emojis")
77 @note_emojis = Gitlab.note_award_emojis(1, 80, 'merge_request', 1)
78 end
79
80 it "gets the correct resources" do
81 expect(a_get("/projects/1/merge_requests/80/notes/1/award_emoji")).to have_been_made
82 end
83
84 it "returns a paginated response of merge request note award emojis" do
85 expect(@note_emojis).to be_a Gitlab::PaginatedResponse
86 expect(@note_emojis.first.awardable_id).to eq(1)
87 expect(@note_emojis.first.awardable_type).to eq("Note")
88 end
89 end
90
91 context 'when snippet note award emojis' do
92 before do
93 stub_get("/projects/1/snippets/80/notes/1/award_emoji", "note_award_emojis")
94 @note_emojis = Gitlab.note_award_emojis(1, 80, 'snippet', 1)
95 end
96
97 it "gets the correct resources" do
98 expect(a_get("/projects/1/snippets/80/notes/1/award_emoji")).to have_been_made
99 end
100
101 it "returns a paginated response of snippet note award emojis" do
102 expect(@note_emojis).to be_a Gitlab::PaginatedResponse
103 expect(@note_emojis.first.awardable_id).to eq(1)
104 expect(@note_emojis.first.awardable_type).to eq("Note")
105 end
106 end
107 end
108
109 describe '.award_emoji' do
110 context 'when issue award emoji' do
111 before do
112 stub_get("/projects/1/issues/80/award_emoji/4", "issue_award_emoji")
113 @emoji = Gitlab.award_emoji(1, 80, 'issue', 4)
114 end
115
116 it "gets the correct resource" do
117 expect(a_get("/projects/1/issues/80/award_emoji/4")).to have_been_made
118 end
119
120 it "returns information about an issue award emoji" do
121 expect(@emoji.id).to eq(4)
122 expect(@emoji.awardable_type).to eq("Issue")
123 expect(@emoji.awardable_id).to eq(80)
124 end
125 end
126
127 context 'when merge request award emoji' do
128 before do
129 stub_get("/projects/1/merge_requests/80/award_emoji/4", "merge_request_award_emoji")
130 @emoji = Gitlab.award_emoji(1, 80, 'merge_request', 4)
131 end
132
133 it "gets the correct resource" do
134 expect(a_get("/projects/1/merge_requests/80/award_emoji/4")).to have_been_made
135 end
136
137 it "returns information about a merge request award emoji" do
138 expect(@emoji.id).to eq(4)
139 expect(@emoji.awardable_type).to eq("MergeRequest")
140 expect(@emoji.awardable_id).to eq(80)
141 end
142 end
143
144 context 'when snippet award emoji' do
145 before do
146 stub_get("/projects/1/snippets/80/award_emoji/4", "snippet_award_emoji")
147 @emoji = Gitlab.award_emoji(1, 80, 'snippet', 4)
148 end
149
150 it "gets the correct resource" do
151 expect(a_get("/projects/1/snippets/80/award_emoji/4")).to have_been_made
152 end
153
154 it "returns information about a snippet award emoji" do
155 expect(@emoji.id).to eq(4)
156 expect(@emoji.awardable_type).to eq("Snippet")
157 expect(@emoji.awardable_id).to eq(80)
158 end
159 end
160 end
161
162 describe '.note_award_emoji' do
163 context 'when issue note award emoji' do
164 before do
165 stub_get("/projects/1/issues/80/notes/1/award_emoji/4", "note_award_emoji")
166 @note_emoji = Gitlab.note_award_emoji(1, 80, 'issue', 1, 4)
167 end
168
169 it "gets the correct resource" do
170 expect(a_get("/projects/1/issues/80/notes/1/award_emoji/4")).to have_been_made
171 end
172
173 it "returns information about an issue note award emoji" do
174 expect(@note_emoji.id).to eq(4)
175 expect(@note_emoji.awardable_type).to eq("Note")
176 expect(@note_emoji.awardable_id).to eq(1)
177 end
178 end
179
180 context 'when merge request note award emoji' do
181 before do
182 stub_get("/projects/1/merge_requests/80/notes/1/award_emoji/4", "note_award_emoji")
183 @note_emoji = Gitlab.note_award_emoji(1, 80, 'merge_request', 1, 4)
184 end
185
186 it "gets the correct resource" do
187 expect(a_get("/projects/1/merge_requests/80/notes/1/award_emoji/4")).to have_been_made
188 end
189
190 it "returns information about a merge request note award emoji" do
191 expect(@note_emoji.id).to eq(4)
192 expect(@note_emoji.awardable_type).to eq("Note")
193 expect(@note_emoji.awardable_id).to eq(1)
194 end
195 end
196
197 context 'when snippet note award emoji' do
198 before do
199 stub_get("/projects/1/snippets/80/notes/1/award_emoji/4", "note_award_emoji")
200 @note_emoji = Gitlab.note_award_emoji(1, 80, 'snippet', 1, 4)
201 end
202
203 it "gets the correct resource" do
204 expect(a_get("/projects/1/snippets/80/notes/1/award_emoji/4")).to have_been_made
205 end
206
207 it "returns information about a snippet note award emoji" do
208 expect(@note_emoji.id).to eq(4)
209 expect(@note_emoji.awardable_type).to eq("Note")
210 expect(@note_emoji.awardable_id).to eq(1)
211 end
212 end
213 end
214
215 describe '.create_award_emoji' do
216 context 'when issue award emoji' do
217 before do
218 stub_post("/projects/1/issues/80/award_emoji", "issue_award_emoji")
219 @emoji = Gitlab.create_award_emoji(1, 80, "issue", "blowfish")
220 end
221
222 it "gets the correct resource" do
223 expect(a_post("/projects/1/issues/80/award_emoji").
224 with(body: { name: 'blowfish' })).to have_been_made
225 end
226
227 it "returns correct information about the created issue award emoji" do
228 expect(@emoji.name).to eq('blowfish')
229 expect(@emoji.awardable_type).to eq('Issue')
230 end
231 end
232
233 context 'when merge request award emoji' do
234 before do
235 stub_post("/projects/1/merge_requests/80/award_emoji", "merge_request_award_emoji")
236 @emoji = Gitlab.create_award_emoji(1, 80, "merge_request", "blowfish")
237 end
238
239 it "gets the correct resource" do
240 expect(a_post("/projects/1/merge_requests/80/award_emoji").
241 with(body: { name: 'blowfish' })).to have_been_made
242 end
243
244 it "returns correct information about the created merge request award emoji" do
245 expect(@emoji.name).to eq('blowfish')
246 expect(@emoji.awardable_type).to eq('MergeRequest')
247 end
248 end
249
250 context 'when snippet award emoji' do
251 before do
252 stub_post("/projects/1/snippets/80/award_emoji", "snippet_award_emoji")
253 @emoji = Gitlab.create_award_emoji(1, 80, "snippet", "blowfish")
254 end
255
256 it "gets the correct resource" do
257 expect(a_post("/projects/1/snippets/80/award_emoji").
258 with(body: { name: 'blowfish' })).to have_been_made
259 end
260
261 it "returns correct information about the created snippet award emoji" do
262 expect(@emoji.name).to eq('blowfish')
263 expect(@emoji.awardable_type).to eq('Snippet')
264 end
265 end
266 end
267
268 describe '.create_note_award_emoji' do
269 context 'when issue note award emoji' do
270 before do
271 stub_post("/projects/1/issues/80/notes/1/award_emoji", "note_award_emoji")
272 @note_emoji = Gitlab.create_note_award_emoji(1, 80, "issue", 1, "mood_bubble_lightning")
273 end
274
275 it "gets the correct resource" do
276 expect(a_post("/projects/1/issues/80/notes/1/award_emoji").
277 with(body: { name: 'mood_bubble_lightning' })).to have_been_made
278 end
279
280 it "returns correct information about the created issue note award emoji" do
281 expect(@note_emoji.name).to eq('mood_bubble_lightning')
282 expect(@note_emoji.awardable_type).to eq('Note')
283 end
284 end
285
286 context 'when merge request note award emoji' do
287 before do
288 stub_post("/projects/1/merge_requests/80/notes/1/award_emoji", "note_award_emoji")
289 @note_emoji = Gitlab.create_note_award_emoji(1, 80, "merge_request", 1, "mood_bubble_lightning")
290 end
291
292 it "gets the correct resource" do
293 expect(a_post("/projects/1/merge_requests/80/notes/1/award_emoji").
294 with(body: { name: 'mood_bubble_lightning' })).to have_been_made
295 end
296
297 it "returns correct information about the created merge request note award emoji" do
298 expect(@note_emoji.name).to eq('mood_bubble_lightning')
299 expect(@note_emoji.awardable_type).to eq('Note')
300 end
301 end
302
303 context 'when snippet note award emoji' do
304 before do
305 stub_post("/projects/1/snippets/80/notes/1/award_emoji", "note_award_emoji")
306 @note_emoji = Gitlab.create_note_award_emoji(1, 80, "snippet", 1, "mood_bubble_lightning")
307 end
308
309 it "gets the correct resource" do
310 expect(a_post("/projects/1/snippets/80/notes/1/award_emoji").
311 with(body: { name: 'mood_bubble_lightning' })).to have_been_made
312 end
313
314 it "returns correct information about the created snippet note award emoji" do
315 expect(@note_emoji.name).to eq('mood_bubble_lightning')
316 expect(@note_emoji.awardable_type).to eq('Note')
317 end
318 end
319 end
320
321 describe '.delete_award_emoji' do
322 context 'when issue award emoji' do
323 before do
324 stub_delete("/projects/1/issues/80/award_emoji/4", "issue_award_emoji")
325 @emoji = Gitlab.delete_award_emoji(1, 80, "issue", 4)
326 end
327
328 it "gets the correct resource" do
329 expect(a_delete("/projects/1/issues/80/award_emoji/4")).to have_been_made
330 end
331 end
332
333 context 'when merge request award emoji' do
334 before do
335 stub_delete("/projects/1/merge_requests/80/award_emoji/4", "merge_request_award_emoji")
336 @emoji = Gitlab.delete_award_emoji(1, 80, "merge_request", 4)
337 end
338
339 it "gets the correct resource" do
340 expect(a_delete("/projects/1/merge_requests/80/award_emoji/4")).to have_been_made
341 end
342 end
343
344 context 'when snippet award emoji' do
345 before do
346 stub_delete("/projects/1/snippets/80/award_emoji/4", "snippet_award_emoji")
347 @emoji = Gitlab.delete_award_emoji(1, 80, "snippet", 4)
348 end
349
350 it "gets the correct resource" do
351 expect(a_delete("/projects/1/snippets/80/award_emoji/4")).to have_been_made
352 end
353 end
354 end
355
356 describe '.delete_note_award_emoji' do
357 context 'when issue note award emoji' do
358 before do
359 stub_delete("/projects/1/issues/80/notes/1/award_emoji/4", "note_award_emoji")
360 @note_emoji = Gitlab.delete_note_award_emoji(1, 80, "issue", 1, 4)
361 end
362
363 it "gets the correct resource" do
364 expect(a_delete("/projects/1/issues/80/notes/1/award_emoji/4")).to have_been_made
365 end
366 end
367
368 context 'when merge request note award emoji' do
369 before do
370 stub_delete("/projects/1/merge_requests/80/notes/1/award_emoji/4", "note_award_emoji")
371 @note_emoji = Gitlab.delete_note_award_emoji(1, 80, "merge_request", 1, 4)
372 end
373
374 it "gets the correct resource" do
375 expect(a_delete("/projects/1/merge_requests/80/notes/1/award_emoji/4")).to have_been_made
376 end
377 end
378
379 context 'when snippet note award emoji' do
380 before do
381 stub_delete("/projects/1/snippets/80/notes/1/award_emoji/4", "note_award_emoji")
382 @note_emoji = Gitlab.delete_note_award_emoji(1, 80, "snippet", 1, 4)
383 end
384
385 it "gets the correct resource" do
386 expect(a_delete("/projects/1/snippets/80/notes/1/award_emoji/4")).to have_been_made
387 end
388 end
389 end
390 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".boards" do
4 before do
5 stub_get("/projects/3/boards", "boards")
6 @boards = Gitlab.boards(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/boards")).to have_been_made
11 end
12
13 it "returns a paginated response of project's boards" do
14 expect(@boards).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".board_lists" do
19 before do
20 stub_get("/projects/3/boards/1/lists", "board_lists")
21 @board_lists = Gitlab.board_lists(3, 1)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/boards/1/lists")).to have_been_made
26 end
27
28 it "returns a paginated response of board's lists" do
29 expect(@board_lists).to be_a Gitlab::PaginatedResponse
30 expect(@board_lists.first.id).to eq(1)
31 end
32 end
33
34 describe ".board_list" do
35 before do
36 stub_get("/projects/3/boards/1/lists/1", "board_list")
37 @board_list = Gitlab.board_list(3, 1, 1)
38 end
39
40 it "gets the correct resource" do
41 expect(a_get("/projects/3/boards/1/lists/1")).to have_been_made
42 end
43
44 it "returns information about the list" do
45 expect(@board_list.id).to eq(1)
46 end
47 end
48
49 describe ".create_board_list" do
50 before do
51 stub_post("/projects/3/boards/1/lists", "board_list")
52 @board_list = Gitlab.create_board_list(3, 1, 4)
53 end
54
55 it "gets the correct resource" do
56 expect(a_post("/projects/3/boards/1/lists")).to have_been_made
57 end
58
59 it "returns information about a created board" do
60 expect(@board_list.position).to eq(1)
61 end
62 end
63
64 describe ".edit_board_list" do
65 before do
66 stub_put("/projects/3/boards/1/lists/1", "board_list")
67 @board_list = Gitlab.edit_board_list(3, 1, 1, 3)
68 end
69
70 it "gets the correct resource" do
71 expect(a_put("/projects/3/boards/1/lists/1")).to have_been_made
72 end
73
74 it "returns information about an edited board" do
75 expect(@board_list.id).to eq(1)
76 end
77 end
78
79 describe ".delete_board_list" do
80 before do
81 stub_delete("/projects/3/boards/1/lists/1", "board_list")
82 @board_list = Gitlab.delete_board_list(3, 1, 1)
83 end
84
85 it "gets the correct resource" do
86 expect(a_delete("/projects/3/boards/1/lists/1")).to have_been_made
87 end
88
89 it "returns information about the deleted board list" do
90 expect(@board_list.id).to eq(1)
91 end
92 end
93 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :repo_branches }
4 it { is_expected.to respond_to :repo_branch }
5 it { is_expected.to respond_to :repo_protect_branch }
6 it { is_expected.to respond_to :repo_unprotect_branch }
7
8 describe ".branches" do
9 before do
10 stub_get("/projects/3/repository/branches", "branches")
11 @branches = Gitlab.branches(3)
12 end
13
14 it "gets the correct resource" do
15 expect(a_get("/projects/3/repository/branches")).to have_been_made
16 end
17
18 it "returns a paginated response of repository branches" do
19 expect(@branches).to be_a Gitlab::PaginatedResponse
20 expect(@branches.first.name).to eq("api")
21 end
22 end
23
24 describe ".branch" do
25 before do
26 stub_get("/projects/3/repository/branches/api", "branch")
27 @branch = Gitlab.branch(3, "api")
28 end
29
30 it "gets the correct resource" do
31 expect(a_get("/projects/3/repository/branches/api")).to have_been_made
32 end
33
34 it "returns information about a repository branch" do
35 expect(@branch.name).to eq("api")
36 end
37 end
38
39 describe ".protect_branch" do
40 before do
41 stub_post("/projects/3/protected_branches", "branch")
42 end
43
44 context "without options" do
45 before do
46 @branch = Gitlab.protect_branch(3, "api")
47 end
48
49 it "updates the correct resource" do
50 expect(a_post("/projects/3/protected_branches")).to have_been_made
51 end
52
53 it "returns information about a protected repository branch" do
54 expect(@branch.name).to eq("api")
55 end
56 end
57
58 context "with options" do
59 before do
60 @branch = Gitlab.protect_branch(3, "api", developers_can_push: true)
61 end
62
63 it "updates the correct resource with the correct options" do
64 expect(
65 a_post("/projects/3/protected_branches").with(body: { name: "api", developers_can_push: 'true' })
66 ).to have_been_made
67 end
68 end
69 end
70
71 describe ".unprotect_branch" do
72 before do
73 stub_delete("/projects/3/protected_branches/api","branch")
74 @branch = Gitlab.unprotect_branch(3, "api")
75 end
76
77 it "gets the correct resource" do
78 expect(a_delete("/projects/3/protected_branches/api")).to have_been_made
79 end
80
81 it "returns information about an unprotected repository branch" do
82 expect(@branch.name).to eq("api")
83 end
84 end
85
86 describe ".create_branch" do
87 before do
88 stub_post("/projects/3/repository/branches", "branch").with(query: { branch: 'api', ref: "master"})
89 @branch = Gitlab.create_branch(3, "api", "master")
90 end
91
92 it "gets the correct resource" do
93 expect(
94 a_post("/projects/3/repository/branches").with(query: { branch: 'api', ref: "master"})
95 ).to have_been_made
96 end
97
98 it "returns information about a new repository branch" do
99 expect(@branch.name).to eq("api")
100 end
101 end
102
103 describe ".delete_branch" do
104 before do
105 stub_delete("/projects/3/repository/branches/api", "branch_delete")
106 @branch = Gitlab.delete_branch(3, "api")
107 end
108
109 it "gets the correct resource" do
110 expect(a_delete("/projects/3/repository/branches/api")).to have_been_made
111 end
112
113 it "returns information about the deleted repository branch" do
114 expect(@branch.branch_name).to eq("api")
115 end
116 end
117 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".variables" do
4 before do
5 stub_get("/projects/3/variables", "variables")
6 @variables = Gitlab.variables(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/variables")).to have_been_made
11 end
12
13 it "returns an array of project's variables" do
14 expect(@variables).to be_a Gitlab::PaginatedResponse
15 expect(@variables.first.key).to eq("TEST_VARIABLE_1")
16 expect(@variables.first.value).to eq("TEST_1")
17 end
18 end
19
20 describe ".variable" do
21 before do
22 stub_get("/projects/3/variables/VARIABLE", "variable")
23 @variable = Gitlab.variable(3, "VARIABLE")
24 end
25
26 it "gets the correct resource" do
27 expect(a_get("/projects/3/variables/VARIABLE")).to have_been_made
28 end
29
30 it "returns information about a variable" do
31 expect(@variable.key).to eq("VARIABLE")
32 expect(@variable.value).to eq("the value")
33 end
34 end
35
36 describe ".create_variable" do
37 before do
38 stub_post("/projects/3/variables", "variable")
39 @variable = Gitlab.create_variable(3, "NEW_VARIABLE", "new value")
40 end
41
42 it "gets the correct resource" do
43 body = { key: "NEW_VARIABLE", value: "new value" }
44 expect(a_post("/projects/3/variables").with(body: body)).to have_been_made
45 end
46
47 it "returns information about a new variable" do
48 expect(@variable.key).to eq("VARIABLE")
49 expect(@variable.value).to eq("the value")
50 end
51 end
52
53 describe ".update_variable" do
54 before do
55 stub_put("/projects/3/variables/UPD_VARIABLE", "variable")
56 @variable = Gitlab.update_variable(3, "UPD_VARIABLE", "updated value")
57 end
58
59 it "puts the correct resource" do
60 body = { value: "updated value" }
61 expect(a_put("/projects/3/variables/UPD_VARIABLE").with(body: body)).to have_been_made
62 end
63
64 it "returns information about an updated variable" do
65 expect(@variable.key).to eq("VARIABLE")
66 expect(@variable.value).to eq("the value")
67 end
68 end
69
70 describe ".remove_variable" do
71 before do
72 stub_delete("/projects/3/variables/DEL_VARIABLE", "variable")
73 @variable = Gitlab.remove_variable(3, "DEL_VARIABLE")
74 end
75
76 it "gets the correct resource" do
77 expect(a_delete("/projects/3/variables/DEL_VARIABLE")).to have_been_made
78 end
79
80 it "returns information about a deleted variable" do
81 expect(@variable.key).to eq("VARIABLE")
82 expect(@variable.value).to eq("the value")
83 end
84 end
85
86 describe ".group_variables" do
87 before do
88 stub_get("/groups/3/variables", "variables")
89 @variables = Gitlab.group_variables(3)
90 end
91
92 it "gets the correct resource" do
93 expect(a_get("/groups/3/variables")).to have_been_made
94 end
95
96 it "returns an array of group's variables" do
97 expect(@variables).to be_a Gitlab::PaginatedResponse
98 expect(@variables.first.key).to eq("TEST_VARIABLE_1")
99 expect(@variables.first.value).to eq("TEST_1")
100 end
101 end
102
103 describe ".group_variable" do
104 before do
105 stub_get("/groups/3/variables/VARIABLE", "variable")
106 @variable = Gitlab.group_variable(3, "VARIABLE")
107 end
108
109 it "gets the correct resource" do
110 expect(a_get("/groups/3/variables/VARIABLE")).to have_been_made
111 end
112
113 it "returns information about a variable" do
114 expect(@variable.key).to eq("VARIABLE")
115 expect(@variable.value).to eq("the value")
116 end
117 end
118
119 describe ".create_group_variable" do
120 before do
121 stub_post("/groups/3/variables", "variable")
122 @variable = Gitlab.create_group_variable(3, "NEW_VARIABLE", "new value")
123 end
124
125 it "gets the correct resource" do
126 body = { key: "NEW_VARIABLE", value: "new value" }
127 expect(a_post("/groups/3/variables").with(body: body)).to have_been_made
128 end
129
130 it "returns information about a new variable" do
131 expect(@variable.key).to eq("VARIABLE")
132 expect(@variable.value).to eq("the value")
133 end
134 end
135
136 describe ".update_group_variable" do
137 before do
138 stub_put("/groups/3/variables/UPD_VARIABLE", "variable")
139 @variable = Gitlab.update_group_variable(3, "UPD_VARIABLE", "updated value")
140 end
141
142 it "puts the correct resource" do
143 body = { value: "updated value" }
144 expect(a_put("/groups/3/variables/UPD_VARIABLE").with(body: body)).to have_been_made
145 end
146
147 it "returns information about an updated variable" do
148 expect(@variable.key).to eq("VARIABLE")
149 expect(@variable.value).to eq("the value")
150 end
151 end
152
153 describe ".remove_group_variable" do
154 before do
155 stub_delete("/groups/3/variables/DEL_VARIABLE", "variable")
156 @variable = Gitlab.remove_group_variable(3, "DEL_VARIABLE")
157 end
158
159 it "gets the correct resource" do
160 expect(a_delete("/groups/3/variables/DEL_VARIABLE")).to have_been_made
161 end
162
163 it "returns information about a deleted variable" do
164 expect(@variable.key).to eq("VARIABLE")
165 expect(@variable.value).to eq("the value")
166 end
167 end
168 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".builds" do
4 before do
5 stub_get("/projects/3/builds", "builds")
6 @builds = Gitlab.builds(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/builds")).to have_been_made
11 end
12
13 it "returns a paginated response of project's builds" do
14 expect(@builds).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".build" do
19 before do
20 stub_get("/projects/3/builds/8", "build")
21 @build = Gitlab.build(3, 8)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/builds/8")).to have_been_made
26 end
27
28 it "returns a single build" do
29 expect(@build).to be_a Gitlab::ObjectifiedHash
30 end
31
32 it "returns information about a build" do
33 expect(@build.id).to eq(8)
34 expect(@build.user.name).to eq("John Smith")
35 end
36 end
37
38 describe ".build_artifacts" do
39 context "when successful request" do
40 before do
41 fixture = load_fixture('build_artifacts')
42 fixture.set_encoding(Encoding::ASCII_8BIT)
43 stub_request(:get, "#{Gitlab.endpoint}/projects/3/builds/8/artifacts").
44 with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
45 to_return(body: fixture.read, headers: { 'Content-Disposition' => "attachment; filename=artifacts.zip" })
46 @build_artifacts = Gitlab.build_artifacts(3, 8)
47 end
48
49 it "gets the correct resource" do
50 expect(a_get("/projects/3/builds/8/artifacts")).to have_been_made
51 end
52
53 it "returns a FileResponse" do
54 expect(@build_artifacts).to be_a Gitlab::FileResponse
55 end
56
57 it "returns a file with filename" do
58 expect(@build_artifacts.filename).to eq "artifacts.zip"
59 end
60 end
61
62 context "when bad request" do
63 it "throws an exception" do
64 stub_get("/projects/3/builds/8/artifacts", "error_project_not_found", 404)
65 expect{ Gitlab.build_artifacts(3, 8) }.to raise_error(Gitlab::Error::NotFound, "Server responded with code 404, message: 404 Project Not Found. Request URI: #{Gitlab.endpoint}/projects/3/builds/8/artifacts")
66 end
67 end
68 end
69
70 describe ".builds_commits" do
71 before do
72 stub_get("/projects/3/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds", "builds_commits")
73 @builds_commits = Gitlab.commit_builds(3, "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd")
74 end
75
76 it "gets the correct resource" do
77 expect(a_get("/projects/3/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds")).to have_been_made
78 end
79
80 it "returns a paginated response of commit builds" do
81 expect(@builds_commits).to be_a Gitlab::PaginatedResponse
82 end
83
84 it "returns information about the builds" do
85 expect(@builds_commits.count).to eq(2)
86 end
87 end
88
89
90
91 describe ".build_cancel" do
92 before do
93 stub_post("/projects/3/builds/8/cancel", "build_cancel")
94 @build_cancel = Gitlab.build_cancel(3, 8)
95 end
96
97 it "gets the correct resource" do
98 expect(a_post("/projects/3/builds/8/cancel")).to have_been_made
99 end
100
101 it "returns a single build" do
102 expect(@build_cancel).to be_a Gitlab::ObjectifiedHash
103 end
104
105 it "returns information about a build" do
106 expect(@build_cancel.commit.author_name).to eq("John Smith")
107 end
108 end
109
110 describe ".build_retry" do
111 before do
112 stub_post("/projects/3/builds/69/retry", "build_retry")
113 @build_retry = Gitlab.build_retry(3, 69)
114 end
115
116 it "gets the correct resource" do
117 expect(a_post("/projects/3/builds/69/retry")).to have_been_made
118 end
119
120 it "returns a single build" do
121 expect(@build_retry).to be_a Gitlab::ObjectifiedHash
122 end
123
124 it "returns information about a build" do
125 expect(@build_retry.commit.author_name).to eq("John Smith")
126 end
127 end
128
129 describe ".build_erase" do
130 before do
131 stub_post("/projects/3/builds/69/erase", "build_erase")
132 @build_retry = Gitlab.build_erase(3, 69)
133 end
134
135 it "gets the correct resource" do
136 expect(a_post("/projects/3/builds/69/erase")).to have_been_made
137 end
138
139 it "returns a single build" do
140 expect(@build_retry).to be_a Gitlab::ObjectifiedHash
141 end
142
143 it "returns information about a build" do
144 expect(@build_retry.commit.author_name).to eq("John Smith")
145 end
146 end
147 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe '#inspect' do
4 it 'masks tokens on inspect' do
5 client = described_class.new(private_token: 'ui3gIYf4MMzTx-Oh5cEBx')
6 inspected = client.inspect
7 expect(inspected).to include('****************cEBx')
8 end
9 end
10 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :repo_commits }
4 it { is_expected.to respond_to :repo_commit }
5 it { is_expected.to respond_to :repo_commit_diff }
6 it { is_expected.to respond_to :repo_commit_comments }
7 it { is_expected.to respond_to :repo_create_commit_comment }
8 it { is_expected.to respond_to :repo_commit_status }
9 it { is_expected.to respond_to :repo_update_commit_status }
10 it { is_expected.to respond_to :repo_commit_merge_requests }
11
12 describe ".commits" do
13 before do
14 stub_get("/projects/3/repository/commits", "project_commits").
15 with(query: { ref_name: "api" })
16 @commits = Gitlab.commits(3, ref_name: "api")
17 end
18
19 it "gets the correct resource" do
20 expect(a_get("/projects/3/repository/commits").
21 with(query: { ref_name: "api" })).to have_been_made
22 end
23
24 it "returns a paginated response of repository commits" do
25 expect(@commits).to be_a Gitlab::PaginatedResponse
26 expect(@commits.first.id).to eq("f7dd067490fe57505f7226c3b54d3127d2f7fd46")
27 end
28 end
29
30 describe ".commit" do
31 before do
32 stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6", "project_commit")
33 @commit = Gitlab.commit(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
34 end
35
36 it "gets the correct resource" do
37 expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6")).
38 to have_been_made
39 end
40
41 it "returns a repository commit" do
42 expect(@commit.id).to eq("6104942438c14ec7bd21c6cd5bd995272b3faff6")
43 end
44 end
45
46 describe ".commit_diff" do
47 before do
48 stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/diff", "project_commit_diff")
49 @diff = Gitlab.commit_diff(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
50 end
51
52 it "gets the correct resource" do
53 expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/diff")).
54 to have_been_made
55 end
56
57 it "returns a diff of a commit" do
58 expect(@diff.new_path).to eq("doc/update/5.4-to-6.0.md")
59 end
60 end
61
62 describe ".commit_comments" do
63 before do
64 stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/comments", "project_commit_comments")
65 @commit_comments = Gitlab.commit_comments(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
66 end
67
68 it "gets the correct resource" do
69 expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/comments")).
70 to have_been_made
71 end
72
73 it "returns commit's comments" do
74 expect(@commit_comments).to be_a Gitlab::PaginatedResponse
75 expect(@commit_comments.length).to eq(2)
76 expect(@commit_comments[0].note).to eq("this is the 1st comment on commit 6104942438c14ec7bd21c6cd5bd995272b3faff6")
77 expect(@commit_comments[0].author.id).to eq(11)
78 expect(@commit_comments[1].note).to eq("another discussion point on commit 6104942438c14ec7bd21c6cd5bd995272b3faff6")
79 expect(@commit_comments[1].author.id).to eq(12)
80 end
81 end
82
83 describe ".create_commit_comment" do
84 before do
85 stub_post("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/comments", "project_commit_comment")
86 @merge_request = Gitlab.create_commit_comment(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6', 'Nice code!')
87 end
88
89 it "returns information about the newly created comment" do
90 expect(@merge_request.note).to eq('Nice code!')
91 expect(@merge_request.author.id).to eq(1)
92 end
93 end
94
95 describe ".commit_status" do
96 before do
97 stub_get("/projects/6/repository/commits/7d938cb8ac15788d71f4b67c035515a160ea76d8/statuses", 'project_commit_status').
98 with(query: { all: 'true' })
99 @statuses = Gitlab.commit_status(6, '7d938cb8ac15788d71f4b67c035515a160ea76d8', all: true)
100 end
101
102 it "gets the correct resource" do
103 expect(a_get("/projects/6/repository/commits/7d938cb8ac15788d71f4b67c035515a160ea76d8/statuses").
104 with(query: { all: true }))
105 end
106
107 it "gets statuses of a commit" do
108 expect(@statuses).to be_kind_of Gitlab::PaginatedResponse
109 expect(@statuses.first.sha).to eq('7d938cb8ac15788d71f4b67c035515a160ea76d8')
110 expect(@statuses.first.ref).to eq('decreased-spec')
111 expect(@statuses.first.status).to eq('failed')
112 expect(@statuses.last.sha).to eq('7d938cb8ac15788d71f4b67c035515a160ea76d8')
113 expect(@statuses.last.status).to eq('success')
114 end
115 end
116
117 describe ".update_commit_status" do
118 before do
119 stub_post("/projects/6/statuses/7d938cb8ac15788d71f4b67c035515a160ea76d8", 'project_update_commit_status').
120 with(query: { name: 'test', ref: 'decreased-spec', state: 'failed' })
121 @status = Gitlab.update_commit_status(6, '7d938cb8ac15788d71f4b67c035515a160ea76d8', 'failed', name: 'test', ref: 'decreased-spec')
122 end
123
124 it "gets the correct resource" do
125 expect(a_post('/projects/6/statuses/7d938cb8ac15788d71f4b67c035515a160ea76d8').
126 with(query: { name: 'test', ref: 'decreased-spec', state: 'failed' }))
127 end
128
129 it "returns information about the newly created status" do
130 expect(@status).to be_kind_of Gitlab::ObjectifiedHash
131 expect(@status.id).to eq(498)
132 expect(@status.sha).to eq('7d938cb8ac15788d71f4b67c035515a160ea76d8')
133 expect(@status.status).to eq('failed')
134 expect(@status.ref).to eq('decreased-spec')
135 end
136 end
137
138 describe ".create_commit" do
139 let(:actions) do
140 [
141 {
142 action: "create",
143 file_path: "foo/bar",
144 content: "some content"
145 }
146 ]
147 end
148
149 let(:query) do
150 {
151 branch: 'dev',
152 commit_message: 'refactors everything',
153 actions: actions,
154 author_email: 'joe@sample.org',
155 author_name: 'Joe Sample'
156 }
157 end
158
159 before do
160 stub_post("/projects/6/repository/commits", 'project_commit_create').with(body: query)
161 @commit = Gitlab.create_commit(6, 'dev', 'refactors everything', actions, {author_email: 'joe@sample.org', author_name: 'Joe Sample'})
162 end
163
164 it "returns id of a created commit" do
165 expect(@commit.id).to eq('ed899a2f4b50b4370feeea94676502b42383c746')
166 end
167 end
168
169 describe ".repo_commit_merge_requests" do
170 before do
171 stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/merge_requests", "project_commit_merge_requests")
172 @commit_merge_requests = Gitlab.commit_merge_requests(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
173 end
174
175 it "gets the correct resource" do
176 expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/merge_requests")).
177 to have_been_made
178 end
179
180 it "returns commit's associated merge_requests" do
181 expect(@commit_merge_requests).to be_a Gitlab::PaginatedResponse
182 expect(@commit_merge_requests.length).to eq(2)
183 expect(@commit_merge_requests[0].iid).to eq(1)
184 expect(@commit_merge_requests[0].author.id).to eq(1)
185 expect(@commit_merge_requests[1].iid).to eq(2)
186 expect(@commit_merge_requests[1].author.id).to eq(2)
187 end
188 end
189 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".deployments" do
4 before do
5 stub_get("/projects/3/deployments", "deployments")
6 @deployments = Gitlab.deployments(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/deployments")).to have_been_made
11 end
12
13 it "returns a paginated response of project's deployments" do
14 expect(@deployments).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".deployment" do
19 before do
20 stub_get("/projects/3/deployments/42", "deployment")
21 @deployment = Gitlab.deployment(3, 42)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/deployments/42")).to have_been_made
26 end
27
28 it "returns a single deployment" do
29 expect(@deployment).to be_a Gitlab::ObjectifiedHash
30 end
31
32 it "returns information about an deployment" do
33 expect(@deployment.id).to eq(42)
34 expect(@deployment.deployable.commit.id).to eq("a91957a858320c0e17f3a0eca7cfacbff50ea29a")
35 end
36 end
37 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".environments" do
4 before do
5 stub_get("/projects/3/environments", "environments")
6 @environments = Gitlab.environments(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/environments")).to have_been_made
11 end
12
13 it "returns a paginated response of project's environments" do
14 expect(@environments).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".environment" do
19 before do
20 stub_get("/projects/3/environments/12", "environment")
21 @environment = Gitlab.environment(3, 12)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/environments/12")).to have_been_made
26 end
27
28 it "returns a single environment" do
29 expect(@environment).to be_a Gitlab::ObjectifiedHash
30 end
31
32 it "returns information about an environment" do
33 expect(@environment.id).to eq(12)
34 expect(@environment.name).to eq("staging")
35 end
36 end
37
38 describe ".create_environment" do
39 context "without external_url" do
40 before do
41 stub_post("/projects/3/environments", "environment")
42 @environment = Gitlab.create_environment(3, 'staging')
43 end
44
45 it "gets the correct resource" do
46 expect(a_post("/projects/3/environments").with(body: { name: 'staging' })).to have_been_made
47 end
48
49 it "returns a single environment" do
50 expect(@environment).to be_a Gitlab::ObjectifiedHash
51 end
52
53 it "returns information about an environment" do
54 expect(@environment.name).to eq("staging")
55 end
56 end
57
58 context "with external_url" do
59 before do
60 stub_post("/projects/3/environments", "environment")
61 @environment = Gitlab.create_environment(3, 'staging', external_url: "https://staging.example.gitlab.com")
62 end
63
64 it "gets the correct resource" do
65 expect(a_post("/projects/3/environments")
66 .with(body: { name: 'staging', external_url: "https://staging.example.gitlab.com" })).to have_been_made
67 end
68 end
69 end
70
71 describe ".edit_environment" do
72 before do
73 stub_put("/projects/3/environments/12", "environment")
74 @environment = Gitlab.edit_environment(3, 12, {
75 name: 'staging',
76 external_url: "https://staging.example.gitlab.com"
77 })
78 end
79
80 it "gets the correct resource" do
81 expect(a_put("/projects/3/environments/12")
82 .with(body: { name: 'staging', external_url: "https://staging.example.gitlab.com" })).to have_been_made
83 end
84
85 it "returns a single environment" do
86 expect(@environment).to be_a Gitlab::ObjectifiedHash
87 end
88
89 it "returns information about an environment" do
90 expect(@environment.name).to eq("staging")
91 end
92 end
93
94 describe ".delete_environment" do
95 before do
96 stub_delete("/projects/3/environments/12", "environment")
97 @environment = Gitlab.delete_environment(3, 12)
98 end
99
100 it "gets the correct resource" do
101 expect(a_delete("/projects/3/environments/12")).to have_been_made
102 end
103
104 it "returns a single pipeline" do
105 expect(@environment).to be_a Gitlab::ObjectifiedHash
106 end
107
108 it "returns information about a pipeline" do
109 expect(@environment.name).to eq("staging")
110 end
111 end
112
113 describe ".stop_environment" do
114 before do
115 stub_post("/projects/3/environments/12/stop", "environment")
116 @environment = Gitlab.stop_environment(3, 12)
117 end
118
119 it "gets the correct resource" do
120 expect(a_post("/projects/3/environments/12/stop")).to have_been_made
121 end
122
123 it "returns a single pipeline" do
124 expect(@environment).to be_a Gitlab::ObjectifiedHash
125 end
126
127 it "returns information about a pipeline" do
128 expect(@environment.name).to eq("staging")
129 end
130 end
131 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".events" do
4 before do
5 stub_get("/events", "user_events")
6 @events = Gitlab.events()
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/events")).to have_been_made
11 end
12
13 it "it returns a response of user's events" do
14 expect(@events).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".user_events" do
19 before do
20 stub_get("/users/1/events", "user_events")
21 @events = Gitlab.user_events(1)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/users/1/events")).to have_been_made
26 end
27
28 it "returns a response of user's contribution events" do
29 expect(@events).to be_a Gitlab::PaginatedResponse
30 end
31 end
32
33 describe '.project_events' do
34 before do
35 stub_get("/1/events", "project_events")
36 @events = Gitlab.project_events(1)
37 end
38
39 it "gets the correct resource" do
40 expect(a_get("/1/events")).to have_been_made
41 end
42
43 it "returns a response of project's visible events" do
44 expect(@events).to be_a Gitlab::PaginatedResponse
45 end
46 end
47 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".group_milestones" do
4 before do
5 stub_get("/groups/3/milestones", "group_milestones")
6 @milestones = Gitlab.group_milestones(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/groups/3/milestones")).to have_been_made
11 end
12
13 it "returns a paginated response of group's milestones" do
14 expect(@milestones).to be_a Gitlab::PaginatedResponse
15 expect(@milestones.first.group_id).to eq(3)
16 end
17 end
18
19 describe ".group_milestone" do
20 before do
21 stub_get("/groups/3/milestones/1", "group_milestone")
22 @milestone = Gitlab.group_milestone(3, 1)
23 end
24
25 it "gets the correct resource" do
26 expect(a_get("/groups/3/milestones/1")).to have_been_made
27 end
28
29 it "returns information about a milestone" do
30 expect(@milestone.group_id).to eq(3)
31 end
32 end
33
34 describe ".create_group_milestone" do
35 before do
36 stub_post("/groups/3/milestones", "group_milestone")
37 @milestone = Gitlab.create_group_milestone(3, 'title')
38 end
39
40 it "gets the correct resource" do
41 expect(a_post("/groups/3/milestones").
42 with(body: { title: 'title' })).to have_been_made
43 end
44
45 it "returns information about a created milestone" do
46 expect(@milestone.group_id).to eq(3)
47 end
48 end
49
50 describe ".edit_group_milestone" do
51 before do
52 stub_put("/groups/3/milestones/33", "group_milestone")
53 @milestone = Gitlab.edit_group_milestone(3, 33, title: 'title')
54 end
55
56 it "gets the correct resource" do
57 expect(a_put("/groups/3/milestones/33").
58 with(body: { title: 'title' })).to have_been_made
59 end
60
61 it "returns information about an edited milestone" do
62 expect(@milestone.group_id).to eq(3)
63 end
64 end
65
66 describe ".group_milestone_issues" do
67 before do
68 stub_get("/groups/3/milestones/1/issues", "group_milestone_issues")
69 @milestone_issues = Gitlab.group_milestone_issues(3, 1)
70 end
71
72 it "gets the correct resource" do
73 expect(a_get("/groups/3/milestones/1/issues")).to have_been_made
74 end
75
76 it "returns a paginated response of milestone's issues" do
77 expect(@milestone_issues).to be_a Gitlab::PaginatedResponse
78 expect(@milestone_issues.first.milestone.id).to eq(1)
79 end
80 end
81
82 describe ".group_milestone_merge_requests" do
83 before do
84 stub_get("/groups/3/milestones/1/merge_requests", "group_milestone_merge_requests")
85 @milestone_merge_requests = Gitlab.group_milestone_merge_requests(3, 1)
86 end
87
88 it "gets the correct resource" do
89 expect(a_get("/groups/3/milestones/1/merge_requests")).to have_been_made
90 end
91
92 it "returns a paginated response of milestone's merge_requests" do
93 expect(@milestone_merge_requests).to be_a Gitlab::PaginatedResponse
94 expect(@milestone_merge_requests.first.milestone.id).to eq(1)
95 end
96 end
97 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".groups" do
4 before do
5 stub_get("/groups", "groups")
6 stub_get("/groups/3", "group")
7 @group = Gitlab.group(3)
8 @groups = Gitlab.groups
9 end
10
11 it "gets the correct resource" do
12 expect(a_get("/groups")).to have_been_made
13 expect(a_get("/groups/3")).to have_been_made
14 end
15
16 it "returns a paginated response of groups" do
17 expect(@groups).to be_a Gitlab::PaginatedResponse
18 expect(@groups.first.path).to eq("threegroup")
19 end
20 end
21
22 describe ".create_group" do
23 context "without description" do
24 before do
25 stub_post("/groups", "group_create")
26 @group = Gitlab.create_group('GitLab-Group', 'gitlab-path')
27 end
28
29 it "gets the correct resource" do
30 expect(a_post("/groups").
31 with(body: { path: 'gitlab-path', name: 'GitLab-Group' })).to have_been_made
32 end
33
34 it "returns information about a created group" do
35 expect(@group.name).to eq("Gitlab-Group")
36 expect(@group.path).to eq("gitlab-group")
37 end
38 end
39
40 context "with description" do
41 before do
42 stub_post("/groups", "group_create_with_description")
43 @group = Gitlab.create_group('GitLab-Group', 'gitlab-path', description: 'gitlab group description')
44 end
45
46 it "gets the correct resource" do
47 expect(a_post("/groups").
48 with(body: { path: 'gitlab-path', name: 'GitLab-Group',
49 description: 'gitlab group description' })).to have_been_made
50 end
51
52 it "returns information about a created group" do
53 expect(@group.name).to eq("Gitlab-Group")
54 expect(@group.path).to eq("gitlab-group")
55 expect(@group.description).to eq("gitlab group description")
56 end
57 end
58 end
59
60 describe ".delete_group" do
61 before do
62 stub_delete("/groups/42", "group_delete")
63 @group = Gitlab.delete_group(42)
64 end
65
66 it "gets the correct resource" do
67 expect(a_delete("/groups/42")).to have_been_made
68 end
69
70 it "returns information about a deleted group" do
71 expect(@group.name).to eq("Gitlab-Group")
72 expect(@group.path).to eq("gitlab-group")
73 end
74 end
75
76 describe ".transfer_project_to_group" do
77 before do
78 stub_post("/projects", "project")
79 @project = Gitlab.create_project('Gitlab')
80 stub_post("/groups", "group_create")
81 @group = Gitlab.create_group('GitLab-Group', 'gitlab-path')
82
83 stub_post("/groups/#{@group.id}/projects/#{@project.id}", "group_create")
84 @group_transfer = Gitlab.transfer_project_to_group(@group.id, @project.id)
85 end
86
87 it "posts to the correct resource" do
88 expect(a_post("/groups/#{@group.id}/projects/#{@project.id}").with(body: { id: @group.id.to_s, project_id: @project.id.to_s })).to have_been_made
89 end
90
91 it "returns information about the group" do
92 expect(@group_transfer.name).to eq(@group.name)
93 expect(@group_transfer.path).to eq(@group.path)
94 expect(@group_transfer.id).to eq(@group.id)
95 end
96 end
97
98 describe ".group_members" do
99 before do
100 stub_get("/groups/3/members", "group_members")
101 @members = Gitlab.group_members(3)
102 end
103
104 it "gets the correct resource" do
105 expect(a_get("/groups/3/members")).to have_been_made
106 end
107
108 it "returns information about a group's members" do
109 expect(@members).to be_a Gitlab::PaginatedResponse
110 expect(@members.size).to eq(2)
111 expect(@members[1].name).to eq("John Smith")
112 end
113 end
114
115 describe ".group_member" do
116 before do
117 stub_get("/groups/3/members/2", "group_member")
118 @member = Gitlab.group_member(3, 2)
119 end
120
121 it "gets the correct resource" do
122 expect(a_get("/groups/3/members/2")).to have_been_made
123 end
124
125 it "returns information about a group member" do
126 expect(@member).to be_a Gitlab::ObjectifiedHash
127 expect(@member.access_level).to eq(10)
128 expect(@member.name).to eq("John Smith")
129 end
130 end
131
132 describe ".add_group_member" do
133 before do
134 stub_post("/groups/3/members", "group_member")
135 @member = Gitlab.add_group_member(3, 1, 40)
136 end
137
138 it "gets the correct resource" do
139 expect(a_post("/groups/3/members").
140 with(body: { user_id: '1', access_level: '40' })).to have_been_made
141 end
142
143 it "returns information about the added member" do
144 expect(@member.name).to eq("John Smith")
145 end
146 end
147
148 describe ".edit_group_member" do
149 before do
150 stub_put("/groups/3/members/1", "group_member_edit")
151 @member = Gitlab.edit_group_member(3, 1, 50)
152 end
153
154 it "gets the correct resource" do
155 expect(a_put("/groups/3/members/1")
156 .with(body: { access_level: '50'})).to have_been_made
157 end
158
159 it "returns information about the edited member" do
160 expect(@member.access_level).to eq(50)
161 end
162 end
163
164 describe ".remove_group_member" do
165 before do
166 stub_delete("/groups/3/members/1", "group_member_delete")
167 @group = Gitlab.remove_group_member(3, 1)
168 end
169
170 it "gets the correct resource" do
171 expect(a_delete("/groups/3/members/1")).to have_been_made
172 end
173
174 it "returns information about the group the member was removed from" do
175 expect(@group.group_id).to eq(3)
176 end
177 end
178
179 describe ".group_projects" do
180 before do
181 stub_get("/groups/4/projects", "group_projects")
182 @projects = Gitlab.group_projects(4)
183 end
184
185 it "gets the list of projects" do
186 expect(a_get("/groups/4/projects")).to have_been_made
187 end
188
189 it "returns a list of of projects under a group" do
190 expect(@projects).to be_a Gitlab::PaginatedResponse
191 expect(@projects.size).to eq(1)
192 expect(@projects[0].name).to eq("Diaspora Client")
193 end
194 end
195
196 describe ".group_search" do
197 before do
198 stub_get("/groups?search=Group", "group_search")
199 @groups = Gitlab.group_search('Group')
200 end
201
202 it "gets the correct resource" do
203 expect(a_get("/groups?search=Group")).to have_been_made
204 end
205
206 it "returns an array of groups found" do
207 expect(@groups.first.id).to eq(5)
208 expect(@groups.last.id).to eq(8)
209 end
210 end
211
212 describe ".group_subgroups" do
213 before do
214 stub_get("/groups/4/subgroups", "group_subgroups")
215 @subgroups = Gitlab.group_subgroups(4)
216 end
217
218 it "gets the list of subroups" do
219 expect(a_get("/groups/4/subgroups")).to have_been_made
220 end
221
222 it "returns an array of subgroups under a group" do
223 expect(@subgroups).to be_a Gitlab::PaginatedResponse
224 expect(@subgroups.size).to eq(1)
225 expect(@subgroups[0].name).to eq("Foobar Group")
226 end
227 end
228
229 describe ".edit_group" do
230 context "using group ID" do
231 before do
232 stub_put("/groups/1", "group_edit").with(body: { description: "An interesting group" })
233 @edited_project = Gitlab.edit_group(1, description: "An interesting group")
234 end
235
236 it "gets the correct resource" do
237 expect(a_put("/groups/1").with(body: { description: "An interesting group" })).to have_been_made
238 end
239
240 it "returns information about an edited group" do
241 expect(@edited_project.description).to eq("An interesting group")
242 end
243 end
244 end
245 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".issues" do
4 context "with project ID passed" do
5 before do
6 stub_get("/projects/3/issues", "project_issues")
7 @issues = Gitlab.issues(3)
8 end
9
10 it "gets the correct resource" do
11 expect(a_get("/projects/3/issues")).to have_been_made
12 end
13
14 it "returns a paginated response of project's issues" do
15 expect(@issues).to be_a Gitlab::PaginatedResponse
16 expect(@issues.first.project_id).to eq(3)
17 end
18 end
19
20 context 'with literal project ID passed' do
21 before do
22 stub_get("/projects/gitlab-org%2Fgitlab-ce/issues", "project_issues")
23 @issues = Gitlab.issues('gitlab-org/gitlab-ce')
24 end
25
26 it "gets the correct resource" do
27 expect(a_get("/projects/gitlab-org%2Fgitlab-ce/issues")).to have_been_made
28 end
29
30 it "returns a paginated response of project's issues" do
31 expect(@issues).to be_a Gitlab::PaginatedResponse
32 expect(@issues.first.project_id).to eq(3)
33 end
34 end
35
36 context "without project ID passed" do
37 before do
38 stub_get("/issues", "issues")
39 @issues = Gitlab.issues
40 end
41
42 it "gets the correct resource" do
43 expect(a_get("/issues")).to have_been_made
44 end
45
46 it "returns a paginated response of user's issues" do
47 expect(@issues).to be_a Gitlab::PaginatedResponse
48 expect(@issues.first.closed).to be_falsey
49 expect(@issues.first.author.name).to eq("John Smith")
50 end
51 end
52 end
53
54 describe ".issue" do
55 before do
56 stub_get("/projects/3/issues/33", "issue")
57 @issue = Gitlab.issue(3, 33)
58 end
59
60 it "gets the correct resource" do
61 expect(a_get("/projects/3/issues/33")).to have_been_made
62 end
63
64 it "returns information about an issue" do
65 expect(@issue.project_id).to eq(3)
66 expect(@issue.assignee.name).to eq("Jack Smith")
67 end
68 end
69
70 describe ".create_issue" do
71 before do
72 stub_post("/projects/3/issues", "issue")
73 @issue = Gitlab.create_issue(3, 'title')
74 end
75
76 it "gets the correct resource" do
77 expect(a_post("/projects/3/issues").
78 with(body: { title: 'title' })).to have_been_made
79 end
80
81 it "returns information about a created issue" do
82 expect(@issue.project_id).to eq(3)
83 expect(@issue.assignee.name).to eq("Jack Smith")
84 end
85 end
86
87 describe ".edit_issue" do
88 before do
89 stub_put("/projects/3/issues/33", "issue")
90 @issue = Gitlab.edit_issue(3, 33, title: 'title')
91 end
92
93 it "gets the correct resource" do
94 expect(a_put("/projects/3/issues/33").
95 with(body: { title: 'title' })).to have_been_made
96 end
97
98 it "returns information about an edited issue" do
99 expect(@issue.project_id).to eq(3)
100 expect(@issue.assignee.name).to eq("Jack Smith")
101 end
102 end
103
104 describe ".close_issue" do
105 before do
106 stub_put("/projects/3/issues/33", "issue")
107 @issue = Gitlab.close_issue(3, 33)
108 end
109
110 it "gets the correct resource" do
111 expect(a_put("/projects/3/issues/33").
112 with(body: { state_event: 'close' })).to have_been_made
113 end
114
115 it "returns information about an closed issue" do
116 expect(@issue.project_id).to eq(3)
117 expect(@issue.assignee.name).to eq("Jack Smith")
118 end
119 end
120
121 describe ".reopen_issue" do
122 before do
123 stub_put("/projects/3/issues/33", "issue")
124 @issue = Gitlab.reopen_issue(3, 33)
125 end
126
127 it "gets the correct resource" do
128 expect(a_put("/projects/3/issues/33").
129 with(body: { state_event: 'reopen' })).to have_been_made
130 end
131
132 it "returns information about an reopened issue" do
133 expect(@issue.project_id).to eq(3)
134 expect(@issue.assignee.name).to eq("Jack Smith")
135 end
136 end
137
138 describe ".subscribe_to_issue" do
139 before do
140 stub_post("/projects/3/issues/33/subscribe", "issue")
141 @issue = Gitlab.subscribe_to_issue(3, 33)
142 end
143
144 it "gets the correct resource" do
145 expect(a_post("/projects/3/issues/33/subscribe")).to have_been_made
146 end
147
148 it "returns information about the subscribed issue" do
149 expect(@issue.project_id).to eq(3)
150 expect(@issue.assignee.name).to eq("Jack Smith")
151 end
152 end
153
154 describe ".unsubscribe_from_issue" do
155 before do
156 stub_post("/projects/3/issues/33/unsubscribe", "issue")
157 @issue = Gitlab.unsubscribe_from_issue(3, 33)
158 end
159
160 it "gets the correct resource" do
161 expect(a_post("/projects/3/issues/33/unsubscribe")).to have_been_made
162 end
163
164 it "returns information about the unsubscribed issue" do
165 expect(@issue.project_id).to eq(3)
166 expect(@issue.assignee.name).to eq("Jack Smith")
167 end
168 end
169
170 describe ".delete_issue" do
171 before do
172 stub_delete("/projects/3/issues/33", "issue")
173 @issue = Gitlab.delete_issue(3, 33)
174 end
175
176 it "gets the correct resource" do
177 expect(a_delete("/projects/3/issues/33")).to have_been_made
178 end
179
180 it "returns information about a deleted issue" do
181 expect(@issue.project_id).to eq(3)
182 expect(@issue.id).to eq(33)
183 end
184 end
185
186 describe ".move_issue" do
187 before do
188 stub_post("/projects/3/issues/33/move", "issue")
189 @issue = Gitlab.move_issue(3, 33, to_project_id: '4')
190 end
191
192 it "gets the correct resource" do
193 expect(a_post("/projects/3/issues/33/move").
194 with(body: { to_project_id: '4' })).to have_been_made
195 end
196
197 it "returns information about the moved issue" do
198 expect(@issue.project_id).to eq(3)
199 expect(@issue.assignee.name).to eq("Jack Smith")
200 end
201 end
202
203 describe ".estimate_time_of_issue" do
204 before do
205 stub_post("/projects/3/issues/33/time_estimate", "issue")
206 @issue = Gitlab.estimate_time_of_issue(3, 33, '3h30m')
207 end
208
209 it "gets the correct resource" do
210 expect(a_post("/projects/3/issues/33/time_estimate").
211 with(body: { duration: '3h30m' })).to have_been_made
212 end
213
214 it "returns information about the estimated issue" do
215 expect(@issue.project_id).to eq(3)
216 expect(@issue.assignee.name).to eq("Jack Smith")
217 end
218 end
219
220 describe ".reset_time_estimate_of_issue" do
221 before do
222 stub_post("/projects/3/issues/33/reset_time_estimate", "issue")
223 @issue = Gitlab.reset_time_estimate_of_issue(3, 33)
224 end
225
226 it "gets the correct resource" do
227 expect(a_post("/projects/3/issues/33/reset_time_estimate")).to have_been_made
228 end
229
230 it "returns information about the estimated issue" do
231 expect(@issue.project_id).to eq(3)
232 expect(@issue.assignee.name).to eq("Jack Smith")
233 end
234 end
235
236 describe ".add_time_spent_on_issue" do
237 before do
238 stub_post("/projects/3/issues/33/add_spent_time", "issue")
239 @issue = Gitlab.add_time_spent_on_issue(3, 33, '3h30m')
240 end
241
242 it "gets the correct resource" do
243 expect(a_post("/projects/3/issues/33/add_spent_time").
244 with(body: { duration: '3h30m' })).to have_been_made
245 end
246
247 it "returns information about the estimated issue" do
248 expect(@issue.project_id).to eq(3)
249 expect(@issue.assignee.name).to eq("Jack Smith")
250 end
251 end
252
253 describe ".reset_time_spent_on_issue" do
254 before do
255 stub_post("/projects/3/issues/33/reset_spent_time", "issue")
256 @issue = Gitlab.reset_time_spent_on_issue(3, 33)
257 end
258
259 it "gets the correct resource" do
260 expect(a_post("/projects/3/issues/33/reset_spent_time")).to have_been_made
261 end
262
263 it "returns information about the estimated issue" do
264 expect(@issue.project_id).to eq(3)
265 expect(@issue.assignee.name).to eq("Jack Smith")
266 end
267 end
268
269 describe ".time_stats_for_issue" do
270 before do
271 stub_get("/projects/3/issues/33/time_stats", "issue")
272 @issue = Gitlab.time_stats_for_issue(3, 33)
273 end
274
275 it "gets the correct resource" do
276 expect(a_get("/projects/3/issues/33/time_stats")).to have_been_made
277 end
278
279 it "returns information about the issue" do
280 expect(@issue.project_id).to eq(3)
281 expect(@issue.assignee.name).to eq("Jack Smith")
282 end
283 end
284 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe '.jobs' do
4 before do
5 stub_get('/projects/1/jobs', 'jobs')
6 @projects = Gitlab.jobs(1)
7 end
8
9 it 'gets the correct resource' do
10 expect(a_get('/projects/1/jobs')).to have_been_made
11 end
12 end
13
14 describe '.jobs - with scopes' do
15 before do
16 stub_get('/projects/1/jobs?scope[]=created&scope[]=running', 'jobs')
17 @projects = Gitlab.jobs(1, scope: %w[created running])
18 end
19
20 it 'gets the correct resource' do
21 expect(a_get('/projects/1/jobs?scope[]=created&scope[]=running')).to have_been_made
22 end
23 end
24
25 describe '.pipeline_jobs' do
26 before do
27 stub_get('/projects/1/pipelines/1/jobs', 'pipeline_jobs')
28 @projects = Gitlab.pipeline_jobs(1, 1)
29 end
30 it 'gets the correct resource' do
31 expect(a_get('/projects/1/pipelines/1/jobs')).to have_been_made
32 end
33 end
34
35 describe '.pipeline_jobs - with scope' do
36 before do
37 stub_get('/projects/1/pipelines/1/jobs?scope[]=running&scope[]=created', 'pipeline_jobs')
38 @projects = Gitlab.pipeline_jobs(1, 1, scope: %w[running created])
39 end
40 it 'gets the correct resource' do
41 expect(a_get('/projects/1/pipelines/1/jobs?scope[]=running&scope[]=created')).to have_been_made
42 end
43 end
44
45 describe '.job' do
46 before do
47 stub_get('/projects/1/jobs/1', 'job')
48 @projects = Gitlab.job(1, 1)
49 end
50 it 'gets the correct resource' do
51 expect(a_get('/projects/1/jobs/1')).to have_been_made
52 end
53 end
54
55 describe '.job_artifacts' do
56 before do
57 stub_get('/projects/1/jobs/1/artifacts', 'job')
58 @projects = Gitlab.job_artifacts(1, 1)
59 end
60 it 'gets the correct resource' do
61 expect(a_get('/projects/1/jobs/1/artifacts')).to have_been_made
62 end
63 end
64
65 describe '.job_artifacts_download' do
66 before do
67 stub_get('/projects/1/jobs/artifacts/master/download?job=Release%20Build', 'job')
68 @projects = Gitlab.job_artifacts_download(1, 'master', 'Release Build')
69 end
70 it 'gets the correct resource' do
71 expect(a_get('/projects/1/jobs/artifacts/master/download?job=Release%20Build')).to have_been_made
72 end
73 end
74
75 describe '.job_trace' do
76 before do
77 stub_get('/projects/1/jobs/1/trace', 'job_trace')
78 @projects = Gitlab.job_trace(1, 1)
79 end
80 it 'gets the correct resource' do
81 expect(a_get('/projects/1/jobs/1/trace')).to have_been_made
82 end
83 end
84
85 describe '.job_cancel' do
86 before do
87 stub_post('/projects/1/jobs/1/cancel', 'job')
88 @projects = Gitlab.job_cancel(1, 1)
89 end
90 it 'gets the correct resource' do
91 expect(a_post('/projects/1/jobs/1/cancel')).to have_been_made
92 end
93 end
94
95 describe '.job_retry' do
96 before do
97 stub_post('/projects/1/jobs/1/retry', 'job')
98 @projects = Gitlab.job_retry(1, 1)
99 end
100 it 'gets the correct resource' do
101 expect(a_post('/projects/1/jobs/1/retry')).to have_been_made
102 end
103 end
104
105 describe '.job_erase' do
106 before do
107 stub_post('/projects/1/jobs/1/erase', 'job')
108 @projects = Gitlab.job_erase(1, 1)
109 end
110 it 'gets the correct resource' do
111 expect(a_post('/projects/1/jobs/1/erase')).to have_been_made
112 end
113 end
114
115 describe '.job_play' do
116 before do
117 stub_post('/projects/1/jobs/1/play', 'job')
118 @projects = Gitlab.job_play(1, 1)
119 end
120 it 'gets the correct resource' do
121 expect(a_post('/projects/1/jobs/1/play')).to have_been_made
122 end
123 end
124
125 describe '.job_artifacts_keep' do
126 before do
127 stub_post('/projects/1/jobs/1/artifacts/keep', 'job')
128 @projects = Gitlab.job_artifacts_keep(1, 1)
129 end
130 it 'gets the correct resource' do
131 expect(a_post('/projects/1/jobs/1/artifacts/keep')).to have_been_made
132 end
133 end
134 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".key" do
4 before do
5 stub_get("/keys/1", "key")
6 @key = Gitlab.key(1)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/keys/1")).to have_been_made
11 end
12
13 it "returns information about a key" do
14 expect(@key.id).to eq(1)
15 expect(@key.title).to eq("narkoz@helium")
16 end
17 end
18 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".labels" do
4 before do
5 stub_get("/projects/3/labels", "labels")
6 @labels = Gitlab.labels(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/labels")).to have_been_made
11 end
12
13 it "returns a paginated response of project's labels" do
14 expect(@labels).to be_a Gitlab::PaginatedResponse
15 expect(@labels.first.name).to eq("Backlog")
16 end
17 end
18
19 describe ".delete" do
20 before do
21 stub_delete("/projects/3/labels", "label")
22 @label = Gitlab.delete_label(3, "Backlog")
23 end
24
25 it "gets the correct resource" do
26 expect(a_delete("/projects/3/labels").
27 with(body: { name: 'Backlog' })).to have_been_made
28 end
29
30 it "returns information about a deleted snippet" do
31 expect(@label.name).to eq("Backlog")
32 end
33 end
34
35 describe ".edit_label" do
36 before do
37 stub_put("/projects/3/labels", "label")
38 @label = Gitlab.edit_label(3, "TODO", new_name: 'Backlog')
39 end
40
41 it "gets the correct resource" do
42 expect(a_put("/projects/3/labels").
43 with(body: { name: 'TODO', new_name: "Backlog" })).to have_been_made
44 end
45
46 it "returns information about an edited label" do
47 expect(@label.name).to eq("Backlog")
48 end
49 end
50
51 describe ".create_label" do
52 before do
53 stub_post("/projects/3/labels", "label")
54 @label = Gitlab.create_label(3, 'Backlog', '#DD10AA')
55 end
56
57 it "gets the correct resource" do
58 expect(a_post("/projects/3/labels").
59 with(body: { name: 'Backlog', color: '#DD10AA' })).to have_been_made
60 end
61
62 it "returns information about a created label" do
63 expect(@label.name).to eq('Backlog')
64 expect(@label.color).to eq('#DD10AA')
65 end
66 end
67
68 describe ".subscribe_to_label" do
69 before do
70 stub_post("/projects/3/labels/Backlog/subscribe", "label")
71 @label = Gitlab.subscribe_to_label(3, 'Backlog')
72 end
73
74 it "gets the correct resource" do
75 expect(a_post("/projects/3/labels/Backlog/subscribe")).to have_been_made
76 end
77
78 it "returns information about the label subscribed to" do
79 expect(@label.name).to eq('Backlog')
80 expect(@label.subscribed).to eq(true)
81 end
82 end
83
84 describe ".unsubscribe_from_label" do
85 before do
86 stub_post("/projects/3/labels/Backlog/unsubscribe", "label_unsubscribe")
87 @label = Gitlab.unsubscribe_from_label(3, 'Backlog')
88 end
89
90 it "gets the correct resource" do
91 expect(a_post("/projects/3/labels/Backlog/unsubscribe")).to have_been_made
92 end
93
94 it "returns information about the label subscribed to" do
95 expect(@label.name).to eq('Backlog')
96 expect(@label.subscribed).to eq(false)
97 end
98 end
99 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe '.project_merge_request_approvals' do
4 before do
5 stub_get("/projects/1/approvals", 'project_merge_request_approvals')
6 @project_mr_approvals = Gitlab.project_merge_request_approvals(1)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/1/approvals")).to have_been_made
11 end
12
13 it "returns the correct objectified hash" do
14 expect(@project_mr_approvals).to be_a Gitlab::ObjectifiedHash
15 end
16 end
17
18 describe '.edit_project_merge_request_approvals' do
19 before do
20 body = { approvals_before_merge: '3', reset_approvals_on_push: 'false', disable_overriding_approvers_per_merge_request: 'true' }
21 stub_post("/projects/1/approvals", 'project_merge_request_approvals').with(body: body)
22 @project_mr_approvals = Gitlab.edit_project_merge_request_approvals(1, approvals_before_merge: 3, reset_approvals_on_push: false, disable_overriding_approvers_per_merge_request: true)
23 end
24
25 it 'gets the correct resource' do
26 body = { approvals_before_merge: '3', reset_approvals_on_push: 'false', disable_overriding_approvers_per_merge_request: 'true' }
27 expect(a_post("/projects/1/approvals").
28 with(body: body)).to have_been_made
29 end
30
31 it "returns the correct updated configuration" do
32 expect(@project_mr_approvals).to be_a Gitlab::ObjectifiedHash
33 expect(@project_mr_approvals.approvals_before_merge).to eq 3
34 expect(@project_mr_approvals.reset_approvals_on_push).to eq false
35 expect(@project_mr_approvals.disable_overriding_approvers_per_merge_request).to eq true
36 end
37 end
38
39 describe '.edit_project_approvers' do
40 before do
41 body = {"approver_ids": ['5'], "approver_group_ids": ['1']}
42 stub_put("/projects/1/approvals", 'project_merge_request_approvals').with(body: body)
43 @project_mr_approvals = Gitlab.edit_project_approvers(1, approver_ids: [5], approver_group_ids: [1])
44 end
45
46 it 'gets the correct resource' do
47 body = {"approver_ids": ['5'], "approver_group_ids": ['1']}
48 expect(a_put("/projects/1/approvals").
49 with(body: body)).to have_been_made
50 end
51
52 it 'returns the correct updated configuration' do
53 expect(@project_mr_approvals).to be_a Gitlab::ObjectifiedHash
54 expect(@project_mr_approvals.approvers.map{|approver| approver['user']['id']}).to eq [5]
55 expect(@project_mr_approvals.approver_groups.map{|approver_group| approver_group['group']['id']}).to eq [1]
56 end
57 end
58
59 describe '.merge_request_approvals' do
60 before do
61 stub_get("/projects/1/merge_requests/5/approvals", 'merge_request_approvals')
62 @merge_request_approvals = Gitlab.merge_request_approvals(1, 5)
63 end
64
65 it 'gets the correct resource' do
66 expect(a_get("/projects/1/merge_requests/5/approvals")).to have_been_made
67 end
68
69 it 'returns the correct objectified hash' do
70 expect(@merge_request_approvals).to be_a Gitlab::ObjectifiedHash
71 expect(@merge_request_approvals.project_id).to eq 1
72 expect(@merge_request_approvals.iid).to eq 5
73 end
74 end
75
76 describe '.edit_merge_request_approvals' do
77 before do
78 body = { approvals_required: '2' }
79 stub_post("/projects/1/merge_requests/5/approvals", 'merge_request_approvals').with(body: body)
80 @merge_request_approvals = Gitlab.edit_merge_request_approvals(1, 5, approvals_required: 2)
81 end
82
83 it 'gets the correct resource' do
84 body = { approvals_required: '2' }
85 expect(a_post("/projects/1/merge_requests/5/approvals").with(body: body)).to have_been_made
86 end
87
88 it 'returns the correct objectified hash' do
89 expect(@merge_request_approvals).to be_a Gitlab::ObjectifiedHash
90 expect(@merge_request_approvals.approvals_required).to eq 2
91 end
92 end
93
94 describe '.edit_merge_request_approvers' do
95 before do
96 body = {"approver_ids": ['1'], "approver_group_ids": ['5']}
97 stub_put("/projects/1/merge_requests/5/approvals", 'merge_request_approvals').with(body: body)
98 @merge_request_approvals = Gitlab.edit_merge_request_approvers(1, 5, approver_ids: [1], approver_group_ids: [5])
99 end
100
101 it 'gets the correct resource' do
102 body = {"approver_ids": ['1'], "approver_group_ids": ['5']}
103 expect(a_put("/projects/1/merge_requests/5/approvals").
104 with(body: body)).to have_been_made
105 end
106
107 it 'returns the correct updated configuration' do
108 expect(@merge_request_approvals).to be_a Gitlab::ObjectifiedHash
109 expect(@merge_request_approvals.approvers.map{|approver| approver['user']['id']}).to eq [1]
110 expect(@merge_request_approvals.approver_groups.map{|approver_group| approver_group['group']['id']}).to eq [5]
111 end
112 end
113
114 describe '.approve_merge_request' do
115 before do
116 stub_post("/projects/1/merge_requests/5/approve", 'merge_request_approvals')
117 @merge_request_approvals = Gitlab.approve_merge_request(1, 5)
118 end
119
120 it 'gets the correct resource' do
121 expect(a_post("/projects/1/merge_requests/5/approve")).to have_been_made
122 end
123
124 it 'returns the correct updated configuration' do
125 expect(@merge_request_approvals).to be_a Gitlab::ObjectifiedHash
126 expect(@merge_request_approvals.merge_status).to eq 'can_be_merged'
127 end
128 end
129
130 describe '.unapprove_merge_request' do
131 before do
132 stub_post("/projects/1/merge_requests/5/unapprove", 'merge_request_approvals')
133 @merge_request_approvals = Gitlab.unapprove_merge_request(1, 5)
134 end
135
136 it 'gets the correct resource' do
137 expect(a_post("/projects/1/merge_requests/5/unapprove")).to have_been_made
138 end
139 end
140 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".user_merge_requests" do
4 before do
5 stub_get("/merge_requests", "merge_requests")
6 @user_merge_requests = Gitlab.user_merge_requests
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/merge_requests")).to have_been_made
11 end
12
13 it "returns a paginated response of user merge requests" do
14 expect(@user_merge_requests).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".merge_requests" do
19 before do
20 stub_get("/projects/3/merge_requests", "merge_requests")
21 @merge_requests = Gitlab.merge_requests(3)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/merge_requests")).to have_been_made
26 end
27
28 it "returns a paginated response of project's merge requests" do
29 expect(@merge_requests).to be_a Gitlab::PaginatedResponse
30 expect(@merge_requests.first.project_id).to eq(3)
31 end
32 end
33
34 describe ".merge_request" do
35 before do
36 stub_get("/projects/3/merge_requests/1", "merge_request")
37 @merge_request = Gitlab.merge_request(3, 1)
38 end
39
40 it "gets the correct resource" do
41 expect(a_get("/projects/3/merge_requests/1")).to have_been_made
42 end
43
44 it "returns information about a merge request" do
45 expect(@merge_request.project_id).to eq(3)
46 expect(@merge_request.assignee.name).to eq("Jack Smith")
47 end
48 end
49
50 describe ".create_merge_request" do
51 before do
52 stub_post("/projects/3/merge_requests", "merge_request")
53 end
54
55 it "returns information about a merge request" do
56 @merge_request = Gitlab.create_merge_request(3, 'New feature',
57 source_branch: 'api',
58 target_branch: 'master'
59 )
60 expect(@merge_request.project_id).to eq(3)
61 expect(@merge_request.assignee.name).to eq("Jack Smith")
62 end
63 end
64
65 describe ".update_merge_request" do
66 before do
67 stub_put("/projects/3/merge_requests/2", "merge_request").
68 with(body: {
69 assignee_id: '1',
70 target_branch: 'master',
71 title: 'A different new feature'
72 })
73 @merge_request = Gitlab.update_merge_request(3, 2,
74 assignee_id: '1',
75 target_branch: 'master',
76 title: 'A different new feature'
77 )
78 end
79
80 it "gets the correct resource" do
81 expect(a_put("/projects/3/merge_requests/2").
82 with(body: {
83 assignee_id: '1',
84 target_branch: 'master',
85 title: 'A different new feature'
86 })).to have_been_made
87 end
88
89 it "returns information about a merge request" do
90 expect(@merge_request.project_id).to eq(3)
91 expect(@merge_request.assignee.name).to eq("Jack Smith")
92 end
93 end
94
95 describe ".accept_merge_request" do
96 before do
97 stub_put("/projects/5/merge_requests/42/merge", "merge_request").
98 with(body: { merge_commit_message: 'Nice!' })
99 @merge_request = Gitlab.accept_merge_request(5, 42, merge_commit_message: 'Nice!')
100 end
101
102 it "gets the correct resource" do
103 expect(a_put("/projects/5/merge_requests/42/merge").
104 with(body: { merge_commit_message: 'Nice!' })).to have_been_made
105 end
106
107 it "returns information about merged merge request" do
108 expect(@merge_request.project_id).to eq(3)
109 expect(@merge_request.assignee.name).to eq("Jack Smith")
110 end
111 end
112
113 describe ".merge_request_comments" do
114 before do
115 stub_get("/projects/3/merge_requests/2/notes", "merge_request_comments")
116 @merge_request = Gitlab.merge_request_comments(3, 2)
117 end
118
119 it "gets the correct resource" do
120 expect(a_get("/projects/3/merge_requests/2/notes")).to have_been_made
121 end
122
123 it "returns merge request's comments" do
124 expect(@merge_request).to be_an Gitlab::PaginatedResponse
125 expect(@merge_request.length).to eq(2)
126 expect(@merge_request[0].note).to eq("this is the 1st comment on the 2merge merge request")
127 expect(@merge_request[0].author.id).to eq(11)
128 expect(@merge_request[1].note).to eq("another discussion point on the 2merge request")
129 expect(@merge_request[1].author.id).to eq(12)
130 end
131 end
132
133 describe ".create_merge_request_comment" do
134 before do
135 stub_post("/projects/3/merge_requests/2/notes", "merge_request_comment")
136 @merge_request = Gitlab.create_merge_request_comment(3, 2, 'Cool Merge Request!')
137 end
138
139 it "gets the correct resource" do
140 expect(a_post("/projects/3/merge_requests/2/notes")).to have_been_made
141 end
142
143 it "returns information about a merge request" do
144 expect(@merge_request.note).to eq('Cool Merge Request!')
145 expect(@merge_request.author.id).to eq(1)
146 end
147 end
148
149 describe ".merge_request_changes" do
150 before do
151 stub_get("/projects/3/merge_requests/2/changes", "merge_request_changes")
152 @mr_changes = Gitlab.merge_request_changes(3, 2)
153 end
154
155 it "gets the correct resource" do
156 expect(a_get("/projects/3/merge_requests/2/changes")).to have_been_made
157 end
158
159 it "returns the merge request changes" do
160 expect(@mr_changes.changes).to be_a Array
161 expect(@mr_changes.changes.first['old_path']).to eq('lib/omniauth/builder.rb')
162 expect(@mr_changes.id).to eq(2)
163 expect(@mr_changes.project_id).to eq(3)
164 expect(@mr_changes.source_branch).to eq('uncovered')
165 expect(@mr_changes.target_branch).to eq('master')
166 end
167 end
168
169 describe ".merge_request_commits" do
170 before do
171 stub_get("/projects/3/merge_requests/2/commits", "merge_request_commits")
172 @mr_commits = Gitlab.merge_request_commits(3, 2)
173 end
174
175 it "gets the correct resource" do
176 expect(a_get("/projects/3/merge_requests/2/commits")).to have_been_made
177 end
178
179 it "returns the merge request commits" do
180 expect(@mr_commits).to be_a Gitlab::PaginatedResponse
181 expect(@mr_commits.size).to eq 2
182 expect(@mr_commits.first.id).to eq "a2da7552f26d5b46a6a09bb8b7b066e3a102be7d"
183 expect(@mr_commits.first.short_id).to eq "a2da7552"
184 expect(@mr_commits.first.title).to eq "piyo"
185 expect(@mr_commits.first.author_name).to eq "example"
186 expect(@mr_commits.first.author_email).to eq "example@example.com"
187 expect(@mr_commits[1].short_id).to eq "3ce50959"
188 expect(@mr_commits[1].title).to eq "hoge"
189 end
190 end
191
192 describe ".merge_request_closes_issues" do
193 before do
194 stub_get("/projects/5/merge_requests/1/closes_issues", "merge_request_closes_issues")
195 @issues = Gitlab.merge_request_closes_issues(5, 1)
196 end
197
198 it "gets the correct resource" do
199 expect(a_get("/projects/5/merge_requests/1/closes_issues")).to have_been_made
200 end
201
202 it "returns a paginated response of the issues the merge_request will close" do
203 expect(@issues).to be_a(Gitlab::PaginatedResponse)
204 expect(@issues.first.title).to eq("Merge request 1 issue 1")
205 expect(@issues.size).to eq(2)
206 end
207 end
208
209 describe ".subscribe_to_merge_request" do
210 before do
211 stub_post("/projects/3/merge_requests/2/subscribe", "merge_request")
212 @merge_request = Gitlab.subscribe_to_merge_request(3, 2)
213 end
214
215 it "gets the correct resource" do
216 expect(a_post("/projects/3/merge_requests/2/subscribe")).to have_been_made
217 end
218
219 it "returns information about a merge request" do
220 expect(@merge_request.project_id).to eq(3)
221 end
222 end
223
224 describe ".unsubscribe_from_merge_request" do
225 before do
226 stub_post("/projects/3/merge_requests/2/unsubscribe", "merge_request")
227 @merge_request = Gitlab.unsubscribe_from_merge_request(3, 2)
228 end
229
230 it "gets the correct resource" do
231 expect(a_post("/projects/3/merge_requests/2/unsubscribe")).to have_been_made
232 end
233
234 it "returns information about a merge request" do
235 expect(@merge_request.project_id).to eq(3)
236 end
237 end
238
239 describe ".merge_request_discussions" do
240 before do
241 stub_get("/projects/3/merge_requests/2/discussions", "merge_request_discussions")
242 @discussions = Gitlab.merge_request_discussions(3, 2)
243 end
244
245 it "gets the correct resource" do
246 expect(a_get("/projects/3/merge_requests/2/discussions")).to have_been_made
247 end
248
249 it "returns information about the discussions" do
250 expect(@discussions.length).to eq(1)
251 expect(@discussions.first.id).to eq('7d66bf19bf835e6a4666130544ba1b5c343fc705')
252 end
253 end
254
255 describe ".merge_request_discussion" do
256 before do
257 stub_get("/projects/3/merge_requests/2/discussions/1", "merge_request_discussion")
258 @discussion = Gitlab.merge_request_discussion(3, 2, 1)
259 end
260
261 it "gets the correct resource" do
262 expect(a_get("/projects/3/merge_requests/2/discussions/1")).to have_been_made
263 end
264
265 it "returns information about the discussions" do
266 expect(@discussion.id).to eq('7d66bf19bf835e6a4666130544ba1b5c343fc705')
267 end
268 end
269
270 describe ".create_merge_request_discussion" do
271 before do
272 stub_post("/projects/3/merge_requests/2/discussions", "merge_request_discussion")
273 @discussion = Gitlab.create_merge_request_discussion(3, 2, body: 'Discussion', position: {old_line: 1})
274 end
275
276 it "posts the correct resource" do
277 expect(a_post("/projects/3/merge_requests/2/discussions").
278 with(body: 'body=Discussion&position[old_line]=1')).to have_been_made
279 end
280
281 it "returns information about the discussions" do
282 expect(@discussion.id).to eq('7d66bf19bf835e6a4666130544ba1b5c343fc705')
283 end
284 end
285
286 describe ".resolve_merge_request_discussion" do
287 before do
288 stub_put("/projects/3/merge_requests/2/discussions/1", "merge_request_discussion")
289 @discussion = Gitlab.resolve_merge_request_discussion(3, 2, 1, resolved: true)
290 end
291
292 it "puts the correct resource" do
293 expect(a_put("/projects/3/merge_requests/2/discussions/1").
294 with(body: 'resolved=true')).to have_been_made
295 end
296
297 it "returns information about the discussions" do
298 expect(@discussion.id).to eq('7d66bf19bf835e6a4666130544ba1b5c343fc705')
299 note = @discussion.notes.first
300 expect(note['id']).to eq(1758)
301 end
302 end
303
304 describe ".create_merge_request_discussion_note" do
305 before do
306 stub_post("/projects/3/merge_requests/2/discussions/1/notes", "merge_request_discussion_note")
307 @note = Gitlab.create_merge_request_discussion_note(3, 2, 1, body: 'note')
308 end
309
310 it "posts the correct resource" do
311 expect(a_post("/projects/3/merge_requests/2/discussions/1/notes").
312 with(body: 'body=note')).to have_been_made
313 end
314
315 it "returns information about the note" do
316 expect(@note.id).to eq(1775)
317 end
318 end
319
320 describe ".update_merge_request_discussion_note" do
321 before do
322 stub_put("/projects/3/merge_requests/2/discussions/1/notes/1", "merge_request_discussion_note")
323 @note = Gitlab.update_merge_request_discussion_note(3, 2, 1, 1, body: 'note2')
324 end
325
326 it "puts the correct resource" do
327 expect(a_put("/projects/3/merge_requests/2/discussions/1/notes/1").
328 with(body: 'body=note2')).to have_been_made
329 end
330
331 it "returns information about the note" do
332 expect(@note.id).to eq(1775)
333 end
334 end
335
336 describe ".delete_merge_request_discussion_note" do
337 before do
338 stub_request(:delete, "https://api.example.com/projects/3/merge_requests/2/discussions/1/notes/1").to_return(body: '')
339 @note = Gitlab.delete_merge_request_discussion_note(3, 2, 1, 1)
340 end
341
342 it "deletes the correct resource" do
343 expect(a_delete("/projects/3/merge_requests/2/discussions/1/notes/1")).to have_been_made
344 end
345
346 it "returns nothing" do
347 expect(@note).to be_falsy
348 end
349 end
350 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".milestones" do
4 before do
5 stub_get("/projects/3/milestones", "milestones")
6 @milestones = Gitlab.milestones(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/milestones")).to have_been_made
11 end
12
13 it "returns a paginated response of project's milestones" do
14 expect(@milestones).to be_a Gitlab::PaginatedResponse
15 expect(@milestones.first.project_id).to eq(3)
16 end
17 end
18
19 describe ".milestone" do
20 before do
21 stub_get("/projects/3/milestones/1", "milestone")
22 @milestone = Gitlab.milestone(3, 1)
23 end
24
25 it "gets the correct resource" do
26 expect(a_get("/projects/3/milestones/1")).to have_been_made
27 end
28
29 it "returns information about a milestone" do
30 expect(@milestone.project_id).to eq(3)
31 end
32 end
33
34 describe ".milestone_issues" do
35 before do
36 stub_get("/projects/3/milestones/1/issues", "milestone_issues")
37 @milestone_issues = Gitlab.milestone_issues(3, 1)
38 end
39
40 it "gets the correct resource" do
41 expect(a_get("/projects/3/milestones/1/issues")).to have_been_made
42 end
43
44 it "returns a paginated response of milestone's issues" do
45 expect(@milestone_issues).to be_a Gitlab::PaginatedResponse
46 expect(@milestone_issues.first.milestone.id).to eq(1)
47 end
48 end
49
50 describe ".milestone_merge_requests" do
51 before do
52 stub_get("/projects/3/milestones/1/merge_requests", "milestone_merge_requests")
53 @milestone_merge_requests = Gitlab.milestone_merge_requests(3, 1)
54 end
55
56 it "gets the correct resource" do
57 expect(a_get("/projects/3/milestones/1/merge_requests")).to have_been_made
58 end
59
60 it "returns a paginated response of milestone's merge_requests" do
61 expect(@milestone_merge_requests).to be_a Gitlab::PaginatedResponse
62 expect(@milestone_merge_requests.first.milestone.id).to eq(1)
63 end
64 end
65
66 describe ".create_milestone" do
67 before do
68 stub_post("/projects/3/milestones", "milestone")
69 @milestone = Gitlab.create_milestone(3, 'title')
70 end
71
72 it "gets the correct resource" do
73 expect(a_post("/projects/3/milestones").
74 with(body: { title: 'title' })).to have_been_made
75 end
76
77 it "returns information about a created milestone" do
78 expect(@milestone.project_id).to eq(3)
79 end
80 end
81
82 describe ".edit_milestone" do
83 before do
84 stub_put("/projects/3/milestones/33", "milestone")
85 @milestone = Gitlab.edit_milestone(3, 33, title: 'title')
86 end
87
88 it "gets the correct resource" do
89 expect(a_put("/projects/3/milestones/33").
90 with(body: { title: 'title' })).to have_been_made
91 end
92
93 it "returns information about an edited milestone" do
94 expect(@milestone.project_id).to eq(3)
95 end
96 end
97 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :namespaces }
4
5 describe ".namespaces" do
6 before do
7 stub_get("/namespaces", "namespaces")
8 @namespaces = Gitlab.namespaces
9 end
10
11 it "gets the correct resource" do
12 expect(a_get("/namespaces")).to have_been_made
13 end
14
15 it "returns a paginated response of namespaces" do
16 expect(@namespaces).to be_a Gitlab::PaginatedResponse
17 expect(@namespaces.first.path).to eq("john")
18 expect(@namespaces.first.kind).to eq("user")
19 end
20 end
21 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe "notes" do
4 context "when wall notes" do
5 before do
6 stub_get("/projects/3/notes", "notes")
7 @notes = Gitlab.notes(3)
8 end
9
10 it "gets the correct resource" do
11 expect(a_get("/projects/3/notes")).to have_been_made
12 end
13
14 it "returns a paginated response of notes" do
15 expect(@notes).to be_a Gitlab::PaginatedResponse
16 expect(@notes.first.author.name).to eq("John Smith")
17 end
18 end
19
20 context "when issue notes" do
21 before do
22 stub_get("/projects/3/issues/7/notes", "notes")
23 @notes = Gitlab.issue_notes(3, 7)
24 end
25
26 it "gets the correct resource" do
27 expect(a_get("/projects/3/issues/7/notes")).to have_been_made
28 end
29
30 it "returns a paginated response of notes" do
31 expect(@notes).to be_a Gitlab::PaginatedResponse
32 expect(@notes.first.author.name).to eq("John Smith")
33 end
34 end
35
36 context "when snippet notes" do
37 before do
38 stub_get("/projects/3/snippets/7/notes", "notes")
39 @notes = Gitlab.snippet_notes(3, 7)
40 end
41
42 it "gets the correct resource" do
43 expect(a_get("/projects/3/snippets/7/notes")).to have_been_made
44 end
45
46 it "returns a paginated response of notes" do
47 expect(@notes).to be_a Gitlab::PaginatedResponse
48 expect(@notes.first.author.name).to eq("John Smith")
49 end
50 end
51
52 context "when merge_request notes" do
53 before do
54 stub_get("/projects/3/merge_requests/7/notes", "notes")
55 @notes = Gitlab.merge_request_notes(3, 7)
56 end
57
58 it "gets the correct resource" do
59 expect(a_get("/projects/3/merge_requests/7/notes")).to have_been_made
60 end
61
62 it "returns a paginated response of notes" do
63 expect(@notes).to be_a Gitlab::PaginatedResponse
64 expect(@notes.first.author.name).to eq("John Smith")
65 end
66 end
67 end
68
69 describe "note" do
70 context "when wall note" do
71 before do
72 stub_get("/projects/3/notes/1201", "note")
73 @note = Gitlab.note(3, 1201)
74 end
75
76 it "gets the correct resource" do
77 expect(a_get("/projects/3/notes/1201")).to have_been_made
78 end
79
80 it "returns information about a note" do
81 expect(@note.body).to eq("The solution is rather tricky")
82 expect(@note.author.name).to eq("John Smith")
83 end
84 end
85
86 context "when issue note" do
87 before do
88 stub_get("/projects/3/issues/7/notes/1201", "note")
89 @note = Gitlab.issue_note(3, 7, 1201)
90 end
91
92 it "gets the correct resource" do
93 expect(a_get("/projects/3/issues/7/notes/1201")).to have_been_made
94 end
95
96 it "returns information about a note" do
97 expect(@note.body).to eq("The solution is rather tricky")
98 expect(@note.author.name).to eq("John Smith")
99 end
100 end
101
102 context "when snippet note" do
103 before do
104 stub_get("/projects/3/snippets/7/notes/1201", "note")
105 @note = Gitlab.snippet_note(3, 7, 1201)
106 end
107
108 it "gets the correct resource" do
109 expect(a_get("/projects/3/snippets/7/notes/1201")).to have_been_made
110 end
111
112 it "returns information about a note" do
113 expect(@note.body).to eq("The solution is rather tricky")
114 expect(@note.author.name).to eq("John Smith")
115 end
116 end
117
118 context "when merge request note" do
119 before do
120 stub_get("/projects/3/merge_requests/7/notes/1201", "note")
121 @note = Gitlab.merge_request_note(3, 7, 1201)
122 end
123
124 it "gets the correct resource" do
125 expect(a_get("/projects/3/merge_requests/7/notes/1201")).to have_been_made
126 end
127
128 it "returns information about a note" do
129 expect(@note.body).to eq("The solution is rather tricky")
130 expect(@note.author.name).to eq("John Smith")
131 end
132 end
133 end
134
135 describe "create note" do
136 context "when wall note" do
137 before do
138 stub_post("/projects/3/notes", "note")
139 @note = Gitlab.create_note(3, "The solution is rather tricky")
140 end
141
142 it "gets the correct resource" do
143 expect(a_post("/projects/3/notes").
144 with(body: { body: 'The solution is rather tricky' })).to have_been_made
145 end
146
147 it "returns information about a created note" do
148 expect(@note.body).to eq("The solution is rather tricky")
149 expect(@note.author.name).to eq("John Smith")
150 end
151 end
152
153 context "when issue note" do
154 before do
155 stub_post("/projects/3/issues/7/notes", "note")
156 @note = Gitlab.create_issue_note(3, 7, "The solution is rather tricky")
157 end
158
159 it "gets the correct resource" do
160 expect(a_post("/projects/3/issues/7/notes").
161 with(body: { body: 'The solution is rather tricky' })).to have_been_made
162 end
163
164 it "returns information about a created note" do
165 expect(@note.body).to eq("The solution is rather tricky")
166 expect(@note.author.name).to eq("John Smith")
167 end
168 end
169
170 context "when snippet note" do
171 before do
172 stub_post("/projects/3/snippets/7/notes", "note")
173 @note = Gitlab.create_snippet_note(3, 7, "The solution is rather tricky")
174 end
175
176 it "gets the correct resource" do
177 expect(a_post("/projects/3/snippets/7/notes").
178 with(body: { body: 'The solution is rather tricky' })).to have_been_made
179 end
180
181 it "returns information about a created note" do
182 expect(@note.body).to eq("The solution is rather tricky")
183 expect(@note.author.name).to eq("John Smith")
184 end
185 end
186
187 context "when merge_request note" do
188 before do
189 stub_post("/projects/3/merge_requests/7/notes", "note")
190 @note = Gitlab.create_merge_request_note(3, 7, "The solution is rather tricky")
191 end
192
193 it "gets the correct resource" do
194 expect(a_post("/projects/3/merge_requests/7/notes").
195 with(body: { body: 'The solution is rather tricky' })).to have_been_made
196 end
197
198 it "returns information about a created note" do
199 expect(@note.body).to eq("The solution is rather tricky")
200 expect(@note.author.name).to eq("John Smith")
201 end
202 end
203 end
204
205 describe "delete note" do
206 context "when wall note" do
207 before do
208 stub_delete("/projects/3/notes/1201", "note")
209 @note = Gitlab.delete_note(3, 1201)
210 end
211
212 it "gets the correct resource" do
213 expect(a_delete("/projects/3/notes/1201")).to have_been_made
214 end
215
216 it "returns information about a deleted note" do
217 expect(@note.id).to eq(1201)
218 end
219 end
220
221 context "when issue note" do
222 before do
223 stub_delete("/projects/3/issues/7/notes/1201", "note")
224 @note = Gitlab.delete_issue_note(3, 7, 1201)
225 end
226
227 it "gets the correct resource" do
228 expect(a_delete("/projects/3/issues/7/notes/1201")).to have_been_made
229 end
230
231 it "returns information about a deleted issue note" do
232 expect(@note.id).to eq(1201)
233 end
234 end
235
236 context "when snippet note" do
237 before do
238 stub_delete("/projects/3/snippets/7/notes/1201", "note")
239 @note = Gitlab.delete_snippet_note(3, 7, 1201)
240 end
241
242 it "gets the correct resource" do
243 expect(a_delete("/projects/3/snippets/7/notes/1201")).to have_been_made
244 end
245
246 it "returns information about a deleted snippet note" do
247 expect(@note.id).to eq(1201)
248 end
249 end
250
251 context "when merge request note" do
252 before do
253 stub_delete("/projects/3/merge_requests/7/notes/1201", "note")
254 @note = Gitlab.delete_merge_request_note(3, 7, 1201)
255 end
256
257 it "gets the correct resource" do
258 expect(a_delete("/projects/3/merge_requests/7/notes/1201")).to have_been_made
259 end
260
261 it "returns information about a deleted merge request note" do
262 expect(@note.id).to eq(1201)
263 end
264 end
265 end
266
267 describe "modify note" do
268 context "when wall note" do
269 before do
270 stub_put("/projects/3/notes/1201", "note")
271 @note = Gitlab.edit_note(3, 1201, "edited wall note content")
272 end
273
274 it "gets the correct resource" do
275 expect(a_put("/projects/3/notes/1201").
276 with(body: {body: 'edited wall note content'})).to have_been_made
277 end
278
279 it "returns information about a modified note" do
280 expect(@note.id).to eq(1201)
281 end
282 end
283
284 context "when issue note" do
285 before do
286 stub_put("/projects/3/issues/7/notes/1201", "note")
287 @note = Gitlab.edit_issue_note(3, 7, 1201, "edited issue note content")
288 end
289
290 it "gets the correct resource" do
291 expect(a_put("/projects/3/issues/7/notes/1201").
292 with(body: {body: 'edited issue note content'})).to have_been_made
293 end
294
295 it "returns information about a modified issue note" do
296 expect(@note.id).to eq(1201)
297 end
298 end
299
300 context "when snippet note" do
301 before do
302 stub_put("/projects/3/snippets/7/notes/1201", "note")
303 @note = Gitlab.edit_snippet_note(3, 7, 1201, "edited snippet note content")
304 end
305
306 it "gets the correct resource" do
307 expect(a_put("/projects/3/snippets/7/notes/1201").
308 with(body: {body: 'edited snippet note content'})).to have_been_made
309 end
310
311 it "returns information about a modified snippet note" do
312 expect(@note.id).to eq(1201)
313 end
314 end
315
316 context "when merge request note" do
317 before do
318 stub_put("/projects/3/merge_requests/7/notes/1201", "note")
319 @note = Gitlab.edit_merge_request_note(3, 7, 1201, "edited merge request note content")
320 end
321
322 it "gets the correct resource" do
323 expect(a_put("/projects/3/merge_requests/7/notes/1201").
324 with(body: {body: 'edited merge request note content'})).to have_been_made
325 end
326
327 it "returns information about a modified request note" do
328 expect(@note.id).to eq(1201)
329 end
330 end
331 end
332 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".pipeline_schedules" do
4 before do
5 stub_get("/projects/3/pipeline_schedules", "pipeline_schedules")
6 @pipeline_schedules = Gitlab.pipeline_schedules(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/pipeline_schedules")).to have_been_made
11 end
12
13 it "returns a response of project's pipeline schedules" do
14 expect(@pipeline_schedules).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".pipeline_schedule" do
19 before do
20 stub_get("/projects/3/pipeline_schedules/5", "pipeline_schedule")
21 @pipeline_schedule = Gitlab.pipeline_schedule(3, 5)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/pipeline_schedules/5")).to have_been_made
26 end
27
28 it "returns a response of project's pipeline schedules" do
29 expect(@pipeline_schedule).to be_a Gitlab::ObjectifiedHash
30 end
31 end
32
33 describe ".create_pipeline_schedule" do
34 before do
35 stub_post("/projects/3/pipeline_schedules", "pipeline_schedule_create")
36 @pipeline_schedule_create = Gitlab.create_pipeline_schedule(3)
37 end
38
39 it "gets the correct resource" do
40 expect(a_post("/projects/3/pipeline_schedules")).to have_been_made
41 end
42
43 it "returns a single pipeline schedule" do
44 expect(@pipeline_schedule_create).to be_a Gitlab::ObjectifiedHash
45 end
46
47 it "returns information about a pipeline schedule" do
48 expect(@pipeline_schedule_create.owner.name).to eq("Administrator")
49 end
50 end
51
52 describe ".edit_pipeline_schedule" do
53 before do
54 stub_put("/projects/3/pipeline_schedules/13", "pipeline_schedule_update")
55 @pipeline_schedule_update = Gitlab.edit_pipeline_schedule(3, 13)
56 end
57
58 it "gets the correct resource" do
59 expect(a_put("/projects/3/pipeline_schedules/13")).to have_been_made
60 end
61
62 it "returns a single pipeline schedule" do
63 expect(@pipeline_schedule_update).to be_a Gitlab::ObjectifiedHash
64 end
65
66 it "returns information about a pipeline schedule" do
67 expect(@pipeline_schedule_update.owner.name).to eq("Administrator")
68 end
69 end
70
71 describe ".pipeline_schedule_take_ownership" do
72 before do
73 stub_post("/projects/3/pipeline_schedules/13/take_ownership", "pipeline_schedule")
74 @pipeline_schedule = Gitlab.pipeline_schedule_take_ownership(3, 13)
75 end
76
77 it "gets the correct resource" do
78 expect(a_post("/projects/3/pipeline_schedules/13/take_ownership")).to have_been_made
79 end
80
81 it "returns information about the pipeline schedule" do
82 expect(@pipeline_schedule.created_at).to eq("2017-05-19T13:31:08.849Z")
83 expect(@pipeline_schedule.description).to eq("Test schedule pipeline")
84 end
85 end
86
87 describe ".delete_pipeline_schedule" do
88 before do
89 stub_delete("/projects/3/pipeline_schedules/13", "pipeline_schedule")
90 @pipeline_schedule = Gitlab.delete_pipeline_schedule(3,13)
91 end
92
93 it "gets the correct resource" do
94 expect(a_delete("/projects/3/pipeline_schedules/13")).to have_been_made
95 end
96
97 it "returns a single pipeline" do
98 expect(@pipeline_schedule).to be_a Gitlab::ObjectifiedHash
99 end
100
101 it "returns information about the deleted pipeline" do
102 # expect(@pipeline_schedule.id).to eq(13)
103 end
104 end
105
106 describe ".create_pipeline_schedule_variable" do
107 before do
108 stub_post("/projects/3/pipeline_schedules/13/variables?key=NEW%20VARIABLE&value=new%20value", "pipeline_schedule_variable")
109 @pipeline_schedule_variable = Gitlab.create_pipeline_schedule_variable(3, 13, {
110 key: "NEW VARIABLE",
111 value: "new value"
112 })
113 end
114
115 it "gets the correct resource" do
116 expect(a_post("/projects/3/pipeline_schedules/13/variables?key=NEW%20VARIABLE&value=new%20value")).to have_been_made
117 end
118
119 it "returns a single variable" do
120 expect(@pipeline_schedule_variable).to be_a Gitlab::ObjectifiedHash
121 end
122
123 it "returns the created variable" do
124 expect(@pipeline_schedule_variable.value).to eq("new value")
125 end
126 end
127
128 describe ".edit_pipeline_schedule_variable" do
129 before do
130 stub_put("/projects/3/pipeline_schedules/13/variables/NEW%20VARIABLE?value=update%20value", "pipeline_schedule_variable_update")
131 @pipeline_schedule_variable = Gitlab.edit_pipeline_schedule_variable(3, 13, "NEW VARIABLE", { value: "update value" })
132 end
133
134 it "returns a single variable" do
135 expect(@pipeline_schedule_variable).to be_a Gitlab::ObjectifiedHash
136 end
137
138 it "has the updated value" do
139 expect(@pipeline_schedule_variable.value).to eq("update value")
140 end
141 end
142
143 describe ".delete_pipeline_schedule_variable" do
144 before do
145 stub_delete("/projects/3/pipeline_schedules/13/variables/NEW%20VARIABLE", "pipeline_schedule_variable")
146 @pipeline_schedule_variable = Gitlab.delete_pipeline_schedule_variable(3, 13, "NEW VARIABLE")
147 end
148
149 it "returns a single variable" do
150 expect(@pipeline_schedule_variable).to be_a Gitlab::ObjectifiedHash
151 end
152
153 it "has the value of the deleted variable" do
154 expect(@pipeline_schedule_variable.value).to eq("new value")
155 end
156 end
157 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :delete_trigger }
4
5 describe ".triggers" do
6 before do
7 stub_get("/projects/3/triggers", "triggers")
8 @triggers = Gitlab.triggers(3)
9 end
10
11 it "gets the correct resource" do
12 expect(a_get("/projects/3/triggers")).to have_been_made
13 end
14
15 it "returns an array of project's triggers" do
16 expect(@triggers).to be_a Gitlab::PaginatedResponse
17 expect(@triggers.first.token).to eq("6d056f63e50fe6f8c5f8f4aa10edb7")
18 end
19 end
20
21 describe ".trigger" do
22 before do
23 stub_get("/projects/3/triggers/10", "trigger")
24 @trigger = Gitlab.trigger(3, 10)
25 end
26
27 it "gets the correct resource" do
28 expect(a_get("/projects/3/triggers/10")).to have_been_made
29 end
30
31 it "returns information about a trigger" do
32 expect(@trigger.created_at).to eq("2016-01-07T09:53:58.235Z")
33 expect(@trigger.token).to eq("6d056f63e50fe6f8c5f8f4aa10edb7")
34 end
35 end
36
37 describe ".create_trigger" do
38 before do
39 stub_post("/projects/3/triggers", "trigger")
40 @trigger = Gitlab.create_trigger(3, "my description")
41 end
42
43 it "gets the correct resource" do
44 expect(a_post("/projects/3/triggers").
45 with(body: { description: "my description" })).to have_been_made
46 end
47
48 it "returns information about a new trigger" do
49 expect(@trigger.created_at).to eq("2016-01-07T09:53:58.235Z")
50 expect(@trigger.token).to eq("6d056f63e50fe6f8c5f8f4aa10edb7")
51 end
52 end
53
54 describe ".update_trigger" do
55 before do
56 stub_put("/projects/3/triggers/1", "trigger")
57 @trigger = Gitlab.update_trigger(3, 1, description: "my description")
58 end
59
60 it "gets the correct resource" do
61 expect(a_put("/projects/3/triggers/1").
62 with(body: { description: "my description" })).to have_been_made
63 end
64
65 it "returns information about the trigger" do
66 expect(@trigger.created_at).to eq("2016-01-07T09:53:58.235Z")
67 expect(@trigger.token).to eq("6d056f63e50fe6f8c5f8f4aa10edb7")
68 end
69 end
70
71 describe ".trigger_take_ownership" do
72 before do
73 stub_post("/projects/3/triggers/1/take_ownership", "trigger")
74 @trigger = Gitlab.trigger_take_ownership(3, 1)
75 end
76
77 it "gets the correct resource" do
78 expect(a_post("/projects/3/triggers/1/take_ownership")).to have_been_made
79 end
80
81 it "returns information about the trigger" do
82 expect(@trigger.created_at).to eq("2016-01-07T09:53:58.235Z")
83 expect(@trigger.token).to eq("6d056f63e50fe6f8c5f8f4aa10edb7")
84 end
85 end
86
87 describe ".remove_trigger" do
88 before do
89 stub_delete("/projects/3/triggers/10", "empty")
90 @trigger = Gitlab.remove_trigger(3, 10)
91 end
92
93 it "gets the correct resource" do
94 expect(a_delete("/projects/3/triggers/10")).to have_been_made
95 end
96 end
97
98 describe ".run_trigger" do
99 before do
100 stub_request(:post, "#{Gitlab.endpoint}/projects/3/trigger/pipeline").
101 to_return(body: load_fixture("run_trigger"), status: 200)
102 end
103
104 context "when private_token is not set" do
105 before do
106 Gitlab.private_token = nil
107 end
108
109 it "does not raise Error::MissingCredentials" do
110 expect { Gitlab.run_trigger(3, "7b9148c158980bbd9bcea92c17522d", "master", {a: 10}) }.to_not raise_error
111 end
112
113 after do
114 Gitlab.private_token = 'secret'
115 end
116 end
117
118 context "without variables" do
119 before do
120 @trigger = Gitlab.run_trigger(3, "7b9148c158980bbd9bcea92c17522d", "master")
121 end
122
123 it "gets the correct resource" do
124 expect(a_request(:post, "#{Gitlab.endpoint}/projects/3/trigger/pipeline").
125 with(body: {
126 token: "7b9148c158980bbd9bcea92c17522d",
127 ref: "master"
128 })).to have_been_made
129 end
130
131 it "returns information about the triggered build" do
132 expect(@trigger.id).to eq(8)
133 end
134 end
135
136 context "with variables" do
137 before do
138 @trigger = Gitlab.run_trigger(3, "7b9148c158980bbd9bcea92c17522d", "master", {a: 10})
139 end
140
141 it "gets the correct resource" do
142 expect(a_request(:post, "#{Gitlab.endpoint}/projects/3/trigger/pipeline").
143 with(body: {
144 token: "7b9148c158980bbd9bcea92c17522d",
145 ref: "master",
146 variables: {a: "10"}
147 })).to have_been_made
148 end
149
150 it "returns information about the triggered build" do
151 expect(@trigger.id).to eq(8)
152 expect(@trigger.variables.a).to eq("10")
153 end
154 end
155 end
156 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".pipelines" do
4 before do
5 stub_get("/projects/3/pipelines", "pipelines")
6 @pipelines = Gitlab.pipelines(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/pipelines")).to have_been_made
11 end
12
13 it "returns a paginated response of project's pipelines" do
14 expect(@pipelines).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe ".pipeline" do
19 before do
20 stub_get("/projects/3/pipelines/46", "pipeline")
21 @pipeline = Gitlab.pipeline(3, 46)
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/pipelines/46")).to have_been_made
26 end
27
28 it "returns a single pipeline" do
29 expect(@pipeline).to be_a Gitlab::ObjectifiedHash
30 end
31
32 it "returns information about a pipeline" do
33 expect(@pipeline.id).to eq(46)
34 expect(@pipeline.user.name).to eq("Administrator")
35 end
36 end
37
38 describe ".create_pipeline" do
39 before do
40 stub_post("/projects/3/pipeline?ref=master", "pipeline_create")
41 @pipeline_create = Gitlab.create_pipeline(3, 'master')
42 end
43
44 it "gets the correct resource" do
45 expect(a_post("/projects/3/pipeline?ref=master")).to have_been_made
46 end
47
48 it "returns a single pipeline" do
49 expect(@pipeline_create).to be_a Gitlab::ObjectifiedHash
50 end
51
52 it "returns information about a pipeline" do
53 expect(@pipeline_create.user.name).to eq("Administrator")
54 end
55 end
56
57 describe ".cancel_pipeline" do
58 before do
59 stub_post("/projects/3/pipelines/46/cancel", "pipeline_cancel")
60 @pipeline_cancel = Gitlab.cancel_pipeline(3, 46)
61 end
62
63 it "gets the correct resource" do
64 expect(a_post("/projects/3/pipelines/46/cancel")).to have_been_made
65 end
66
67 it "returns a single pipeline" do
68 expect(@pipeline_cancel).to be_a Gitlab::ObjectifiedHash
69 end
70
71 it "returns information about a pipeline" do
72 expect(@pipeline_cancel.user.name).to eq("Administrator")
73 end
74 end
75
76 describe ".retry_pipeline" do
77 before do
78 stub_post("/projects/3/pipelines/46/retry", "pipeline_retry")
79 @pipeline_retry = Gitlab.retry_pipeline(3, 46)
80 end
81
82 it "gets the correct resource" do
83 expect(a_post("/projects/3/pipelines/46/retry")).to have_been_made
84 end
85
86 it "returns a single pipeline" do
87 expect(@pipeline_retry).to be_a Gitlab::ObjectifiedHash
88 end
89
90 it "returns information about a pipeline" do
91 expect(@pipeline_retry.user.name).to eq("Administrator")
92 end
93 end
94 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :search_projects }
4
5 describe ".projects" do
6 before do
7 stub_get("/projects", "projects")
8 @projects = Gitlab.projects
9 end
10
11 it "gets the correct resource" do
12 expect(a_get("/projects")).to have_been_made
13 end
14
15 it "returns a paginated response of projects" do
16 expect(@projects).to be_a Gitlab::PaginatedResponse
17 expect(@projects.first.name).to eq("Brute")
18 expect(@projects.first.owner.name).to eq("John Smith")
19 end
20 end
21
22 describe ".project_search" do
23 before do
24 stub_get("/projects?search=Gitlab", "project_search")
25 @project_search = Gitlab.project_search("Gitlab")
26 end
27
28 it "gets the correct resource" do
29 expect(a_get("/projects?search=Gitlab")).to have_been_made
30 end
31
32 it "returns a paginated response of projects found" do
33 expect(@project_search).to be_a Gitlab::PaginatedResponse
34 expect(@project_search.first.name).to eq("Gitlab")
35 expect(@project_search.first.owner.name).to eq("John Smith")
36 end
37 end
38
39 describe ".project" do
40 before do
41 stub_get("/projects/3", "project")
42 @project = Gitlab.project(3)
43 end
44
45 it "gets the correct resource" do
46 expect(a_get("/projects/3")).to have_been_made
47 end
48
49 it "returns information about a project" do
50 expect(@project.name).to eq("Gitlab")
51 expect(@project.owner.name).to eq("John Smith")
52 end
53 end
54
55 describe ".create_project" do
56 before do
57 stub_post("/projects", "project")
58 @project = Gitlab.create_project('Gitlab')
59 end
60
61 it "gets the correct resource" do
62 expect(a_post("/projects")).to have_been_made
63 end
64
65 it "returns information about a created project" do
66 expect(@project.name).to eq("Gitlab")
67 expect(@project.owner.name).to eq("John Smith")
68 end
69 end
70
71 describe ".create_project for user" do
72 before do
73 stub_post("/users", "user")
74 @owner = Gitlab.create_user("john@example.com", "pass", name: 'John Owner')
75 stub_post("/projects/user/#{@owner.id}", "project_for_user")
76 @project = Gitlab.create_project('Brute', user_id: @owner.id)
77 end
78
79 it "returns information about a created project" do
80 expect(@project.name).to eq("Brute")
81 expect(@project.owner.name).to eq("John Owner")
82 end
83 end
84
85 describe ".delete_project" do
86 before do
87 stub_delete("/projects/Gitlab", "project")
88 @project = Gitlab.delete_project('Gitlab')
89 end
90
91 it "gets the correct resource" do
92 expect(a_delete("/projects/Gitlab")).to have_been_made
93 end
94
95 it "returns information about a deleted project" do
96 expect(@project.name).to eq("Gitlab")
97 expect(@project.owner.name).to eq("John Smith")
98 end
99 end
100
101 describe ".create_fork" do
102 context "without sudo option" do
103 before do
104 stub_post("/projects/3/fork", "project_fork")
105 @project = Gitlab.create_fork(3)
106 end
107
108 it "posts to the correct resource" do
109 expect(a_post("/projects/3/fork")).to have_been_made
110 end
111
112 it "returns information about the forked project" do
113 expect(@project.forked_from_project.id).to eq(3)
114 expect(@project.id).to eq(20)
115 end
116 end
117
118 context "with the sudo option" do
119 before do
120 stub_post("/projects/3/fork", "project_forked_for_user")
121 @sudoed_username = 'jack.smith'
122 @project = Gitlab.create_fork(3, sudo: @sudoed_username)
123 end
124
125 it "posts to the correct resource" do
126 expect(a_post("/projects/3/fork")).to have_been_made
127 end
128
129 it "returns information about the forked project" do
130 expect(@project.forked_from_project.id).to eq(3)
131 expect(@project.id).to eq(20)
132 expect(@project.owner.username).to eq(@sudoed_username)
133 end
134 end
135 end
136
137 describe ".project_forks" do
138 before do
139 stub_get("/projects/3/forks", "project_forks")
140 @project_forks = Gitlab.project_forks(3)
141 end
142
143 it "gets the correct resource" do
144 expect(a_get("/projects/3/forks")).to have_been_made
145 end
146
147 it "returns a paginated response of projects found" do
148 expect(@project_forks).to be_a Gitlab::PaginatedResponse
149 expect(@project_forks.first.name).to eq("gitlab")
150 expect(@project_forks.first.owner.name).to eq("Administrator")
151 end
152 end
153
154 describe ".team_members" do
155 before do
156 stub_get("/projects/3/members", "team_members")
157 @team_members = Gitlab.team_members(3)
158 end
159
160 it "gets the correct resource" do
161 expect(a_get("/projects/3/members")).to have_been_made
162 end
163
164 it "returns a paginated response of team members" do
165 expect(@team_members).to be_a Gitlab::PaginatedResponse
166 expect(@team_members.first.name).to eq("John Smith")
167 end
168 end
169
170 describe ".team_member" do
171 before do
172 stub_get("/projects/3/members/1", "team_member")
173 @team_member = Gitlab.team_member(3, 1)
174 end
175
176 it "gets the correct resource" do
177 expect(a_get("/projects/3/members/1")).to have_been_made
178 end
179
180 it "returns information about a team member" do
181 expect(@team_member.name).to eq("John Smith")
182 end
183 end
184
185 describe ".add_team_member" do
186 before do
187 stub_post("/projects/3/members", "team_member")
188 @team_member = Gitlab.add_team_member(3, 1, 40)
189 end
190
191 it "gets the correct resource" do
192 expect(a_post("/projects/3/members").
193 with(body: { user_id: '1', access_level: '40' })).to have_been_made
194 end
195
196 it "returns information about an added team member" do
197 expect(@team_member.name).to eq("John Smith")
198 end
199 end
200
201 describe ".edit_team_member" do
202 before do
203 stub_put("/projects/3/members/1", "team_member")
204 @team_member = Gitlab.edit_team_member(3, 1, 40)
205 end
206
207 it "gets the correct resource" do
208 expect(a_put("/projects/3/members/1").
209 with(body: { access_level: '40' })).to have_been_made
210 end
211
212 it "returns information about an edited team member" do
213 expect(@team_member.name).to eq("John Smith")
214 end
215 end
216
217 describe ".remove_team_member" do
218 before do
219 stub_delete("/projects/3/members/1", "team_member")
220 @team_member = Gitlab.remove_team_member(3, 1)
221 end
222
223 it "gets the correct resource" do
224 expect(a_delete("/projects/3/members/1")).to have_been_made
225 end
226
227 it "returns information about a removed team member" do
228 expect(@team_member.name).to eq("John Smith")
229 end
230 end
231
232 describe ".project_hooks" do
233 before do
234 stub_get("/projects/1/hooks", "project_hooks")
235 @hooks = Gitlab.project_hooks(1)
236 end
237
238 it "gets the correct resource" do
239 expect(a_get("/projects/1/hooks")).to have_been_made
240 end
241
242 it "returns a paginated response of hooks" do
243 expect(@hooks).to be_a Gitlab::PaginatedResponse
244 expect(@hooks.first.url).to eq("https://api.example.net/v1/webhooks/ci")
245 end
246 end
247
248 describe ".project_hook" do
249 before do
250 stub_get("/projects/1/hooks/1", "project_hook")
251 @hook = Gitlab.project_hook(1, 1)
252 end
253
254 it "gets the correct resource" do
255 expect(a_get("/projects/1/hooks/1")).to have_been_made
256 end
257
258 it "returns information about a hook" do
259 expect(@hook.url).to eq("https://api.example.net/v1/webhooks/ci")
260 end
261 end
262
263 describe ".add_project_hook" do
264 context "without specified events" do
265 before do
266 stub_post("/projects/1/hooks", "project_hook")
267 @hook = Gitlab.add_project_hook(1, "https://api.example.net/v1/webhooks/ci")
268 end
269
270 it "gets the correct resource" do
271 body = { url: "https://api.example.net/v1/webhooks/ci" }
272 expect(a_post("/projects/1/hooks").with(body: body)).to have_been_made
273 end
274
275 it "returns information about an added hook" do
276 expect(@hook.url).to eq("https://api.example.net/v1/webhooks/ci")
277 end
278 end
279
280 context "with specified events" do
281 before do
282 stub_post("/projects/1/hooks", "project_hook")
283 @hook = Gitlab.add_project_hook(1, "https://api.example.net/v1/webhooks/ci", push_events: true, merge_requests_events: true)
284 end
285
286 it "gets the correct resource" do
287 body = { url: "https://api.example.net/v1/webhooks/ci", push_events: "true", merge_requests_events: "true" }
288 expect(a_post("/projects/1/hooks").with(body: body)).to have_been_made
289 end
290
291 it "returns information about an added hook" do
292 expect(@hook.url).to eq("https://api.example.net/v1/webhooks/ci")
293 end
294 end
295 end
296
297 describe ".edit_project_hook" do
298 before do
299 stub_put("/projects/1/hooks/1", "project_hook")
300 @hook = Gitlab.edit_project_hook(1, 1, "https://api.example.net/v1/webhooks/ci")
301 end
302
303 it "gets the correct resource" do
304 body = { url: "https://api.example.net/v1/webhooks/ci" }
305 expect(a_put("/projects/1/hooks/1").with(body: body)).to have_been_made
306 end
307
308 it "returns information about an edited hook" do
309 expect(@hook.url).to eq("https://api.example.net/v1/webhooks/ci")
310 end
311 end
312
313 describe ".edit_project" do
314 context "using project ID" do
315 before do
316 stub_put("/projects/3", "project_edit").with(body: { name: "Gitlab-edit" })
317 @edited_project = Gitlab.edit_project(3, name: "Gitlab-edit")
318 end
319
320 it "gets the correct resource" do
321 expect(a_put("/projects/3").with(body: { name: "Gitlab-edit" })).to have_been_made
322 end
323
324 it "returns information about an edited project" do
325 expect(@edited_project.name).to eq("Gitlab-edit")
326 end
327 end
328
329 context "using namespaced project path" do
330 it "encodes the path properly" do
331 stub = stub_put("/projects/namespace%2Fpath", "project_edit").with(body: { name: "Gitlab-edit" })
332 Gitlab.edit_project('namespace/path', name: "Gitlab-edit")
333 expect(stub).to have_been_requested
334 end
335 end
336 end
337
338 describe ".delete_project_hook" do
339 context "when empty response" do
340 before do
341 stub_request(:delete, "#{Gitlab.endpoint}/projects/1/hooks/1").
342 with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
343 to_return(body: '')
344 @hook = Gitlab.delete_project_hook(1, 1)
345 end
346
347 it "gets the correct resource" do
348 expect(a_delete("/projects/1/hooks/1")).to have_been_made
349 end
350
351 it "returns false" do
352 expect(@hook).to be(false)
353 end
354 end
355
356 context "when JSON response" do
357 before do
358 stub_delete("/projects/1/hooks/1", "project_hook")
359 @hook = Gitlab.delete_project_hook(1, 1)
360 end
361
362 it "gets the correct resource" do
363 expect(a_delete("/projects/1/hooks/1")).to have_been_made
364 end
365
366 it "returns information about a deleted hook" do
367 expect(@hook.url).to eq("https://api.example.net/v1/webhooks/ci")
368 end
369 end
370 end
371
372 describe ".push_rule" do
373 before do
374 stub_get("/projects/1/push_rule", "push_rule")
375 @push_rule = Gitlab.push_rule(1)
376 end
377
378 it "gets the correct resource" do
379 expect(a_get("/projects/1/push_rule")).to have_been_made
380 end
381
382 it "returns information about a push rule" do
383 expect(@push_rule.commit_message_regex).to eq("\\b[A-Z]{3}-[0-9]+\\b")
384 end
385 end
386
387 describe ".add_push_rule" do
388 before do
389 stub_post("/projects/1/push_rule", "push_rule")
390 @push_rule = Gitlab.add_push_rule(1, { deny_delete_tag: false, commit_message_regex: "\\b[A-Z]{3}-[0-9]+\\b" })
391 end
392
393 it "gets the correct resource" do
394 expect(a_post("/projects/1/push_rule")).to have_been_made
395 end
396
397 it "returns information about an added push rule" do
398 expect(@push_rule.commit_message_regex).to eq("\\b[A-Z]{3}-[0-9]+\\b")
399 end
400 end
401
402 describe ".edit_push_rule" do
403 before do
404 stub_put("/projects/1/push_rule", "push_rule")
405 @push_rule = Gitlab.edit_push_rule(1, { deny_delete_tag: false, commit_message_regex: "\\b[A-Z]{3}-[0-9]+\\b" })
406 end
407
408 it "gets the correct resource" do
409 expect(a_put("/projects/1/push_rule")).to have_been_made
410 end
411
412 it "returns information about an edited push rule" do
413 expect(@push_rule.commit_message_regex).to eq("\\b[A-Z]{3}-[0-9]+\\b")
414 end
415 end
416
417 describe ".delete_push_rule" do
418 context "when empty response" do
419 before do
420 stub_request(:delete, "#{Gitlab.endpoint}/projects/1/push_rule").
421 with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
422 to_return(body: '')
423 @push_rule = Gitlab.delete_push_rule(1)
424 end
425
426 it "gets the correct resource" do
427 expect(a_delete("/projects/1/push_rule")).to have_been_made
428 end
429
430 it "returns false" do
431 expect(@push_rule).to be(false)
432 end
433 end
434
435 context "when JSON response" do
436 before do
437 stub_delete("/projects/1/push_rule", "push_rule")
438 @push_rule = Gitlab.delete_push_rule(1)
439 end
440
441 it "gets the correct resource" do
442 expect(a_delete("/projects/1/push_rule")).to have_been_made
443 end
444
445 it "returns information about a deleted push rule" do
446 expect(@push_rule.commit_message_regex).to eq("\\b[A-Z]{3}-[0-9]+\\b")
447 end
448 end
449 end
450
451 describe ".make_forked_from" do
452 before do
453 stub_post("/projects/42/fork/24", "project_fork_link")
454 @forked_project_link = Gitlab.make_forked_from(42, 24)
455 end
456
457 it "gets the correct resource" do
458 expect(a_post("/projects/42/fork/24")).to have_been_made
459 end
460
461 it "returns information about a forked project" do
462 expect(@forked_project_link.forked_from_project_id).to eq(24)
463 expect(@forked_project_link.forked_to_project_id).to eq(42)
464 end
465 end
466
467 describe ".remove_forked" do
468 before do
469 stub_delete("/projects/42/fork", "project_fork_link")
470 @forked_project_link = Gitlab.remove_forked(42)
471 end
472
473 it "gets the correct resource" do
474 expect(a_delete("/projects/42/fork")).to have_been_made
475 end
476
477 it "returns information about an unforked project" do
478 expect(@forked_project_link.forked_to_project_id).to eq(42)
479 end
480 end
481
482 describe ".deploy_keys" do
483 before do
484 stub_get("/projects/42/deploy_keys", "project_keys")
485 @deploy_keys = Gitlab.deploy_keys(42)
486 end
487
488 it "gets the correct resource" do
489 expect(a_get("/projects/42/deploy_keys")).to have_been_made
490 end
491
492 it "returns project deploy keys" do
493 expect(@deploy_keys).to be_a Gitlab::PaginatedResponse
494 expect(@deploy_keys.first.id).to eq 2
495 expect(@deploy_keys.first.title).to eq "Key Title"
496 expect(@deploy_keys.first.key).to match(/ssh-rsa/)
497 end
498 end
499
500 describe ".deploy_key" do
501 before do
502 stub_get("/projects/42/deploy_keys/2", "project_key")
503 @deploy_key = Gitlab.deploy_key(42, 2)
504 end
505
506 it "gets the correct resource" do
507 expect(a_get("/projects/42/deploy_keys/2")).to have_been_made
508 end
509
510 it "returns project deploy key" do
511 expect(@deploy_key.id).to eq 2
512 expect(@deploy_key.title).to eq "Key Title"
513 expect(@deploy_key.key).to match(/ssh-rsa/)
514 end
515 end
516
517 describe ".create_deploy_key" do
518 context 'no options' do
519 before do
520 stub_post("/projects/42/deploy_keys", "project_key")
521 @deploy_key = Gitlab.create_deploy_key(42, 'My Key', 'Key contents')
522 end
523
524 it "gets the correct resource" do
525 expect(a_post("/projects/42/deploy_keys").
526 with(body: { title: 'My Key', key: 'Key contents' })).to have_been_made
527 end
528
529 it "returns information about a created key" do
530 expect(@deploy_key.id).to eq(2)
531 end
532 end
533
534 context 'some options' do
535 before do
536 stub_post("/projects/42/deploy_keys", "project_key")
537 @deploy_key = Gitlab.create_deploy_key(42, 'My Key', 'Key contents', can_push: true)
538 end
539
540 it "gets the correct resource" do
541 expect(a_post("/projects/42/deploy_keys").
542 with(body: { title: 'My Key', key: 'Key contents', can_push: true })).to have_been_made
543 end
544
545 it "returns information about a created key" do
546 expect(@deploy_key.id).to eq(2)
547 end
548 end
549 end
550
551 describe ".delete_deploy_key" do
552 before do
553 stub_delete("/projects/42/deploy_keys/2", "project_key")
554 @deploy_key = Gitlab.delete_deploy_key(42, 2)
555 end
556
557 it "gets the correct resource" do
558 expect(a_delete("/projects/42/deploy_keys/2")).to have_been_made
559 end
560
561 it "returns information about a deleted key" do
562 expect(@deploy_key.id).to eq(2)
563 end
564 end
565
566 describe ".enable_deploy_key" do
567 before do
568 stub_post("/projects/42/deploy_keys/2/enable", "project_key")
569 @deploy_key = Gitlab.enable_deploy_key(42, 2)
570 end
571
572 it "gets the correct resource" do
573 expect(a_post("/projects/42/deploy_keys/2/enable").
574 with(body: { id: '42', key_id: '2' })).to have_been_made
575 end
576
577 it "returns information about an enabled key" do
578 expect(@deploy_key.id).to eq(2)
579 end
580 end
581
582 describe ".disable_deploy_key" do
583 before do
584 stub_post("/projects/42/deploy_keys/2/disable", "project_key")
585 @deploy_key = Gitlab.disable_deploy_key(42, 2)
586 end
587
588 it "gets the correct resource" do
589 expect(a_post("/projects/42/deploy_keys/2/disable").
590 with(body: { id: '42', key_id: '2' })).to have_been_made
591 end
592
593 it "returns information about a disabled key" do
594 expect(@deploy_key.id).to eq(2)
595 end
596 end
597
598 describe ".share_project_with_group" do
599 before do
600 stub_post("/projects/3/share", "group")
601 @group = Gitlab.share_project_with_group(3, 10, 40)
602 end
603
604 it "gets the correct resource" do
605 expect(a_post("/projects/3/share").
606 with(body: { group_id: '10', group_access: '40' })).to have_been_made
607 end
608
609 it "returns information about an added group" do
610 expect(@group.id).to eq(10)
611 end
612 end
613
614 describe ".unshare_project_with_group" do
615 before do
616 stub_delete("/projects/3/share/10", "group")
617 @group = Gitlab.unshare_project_with_group(3, 10)
618 end
619
620 it "gets the correct resource" do
621 expect(a_delete("/projects/3/share/10")).to have_been_made
622 end
623 end
624
625 describe ".star_project" do
626 before do
627 stub_post("/projects/3/star", "project_star")
628 @starred_project = Gitlab.star_project(3)
629 end
630
631 it "gets the correct resource" do
632 expect(a_post("/projects/3/star")).to have_been_made
633 end
634
635 it "returns information about the starred project" do
636 expect(@starred_project.id).to eq(3)
637 end
638 end
639
640 describe ".unstar_project" do
641 before do
642 stub_delete("/projects/3/star", "project_unstar")
643 @unstarred_project = Gitlab.unstar_project(3)
644 end
645
646 it "gets the correct resource" do
647 expect(a_delete("/projects/3/star")).to have_been_made
648 end
649
650 it "returns information about the unstarred project" do
651 expect(@unstarred_project.id).to eq(3)
652 end
653 end
654
655 describe ".user_projects" do
656 let(:user_id) { 1 }
657 let(:project_id) { 1 }
658
659 before do
660 stub_get("/users/#{user_id}/projects", "user_projects")
661 @user_projects = Gitlab.user_projects(user_id)
662 end
663
664 it "gets the correct resource" do
665 expect(a_get("/users/#{user_id}/projects")).to have_been_made
666 end
667
668 it "returns a paginated response of projects" do
669 expect(@user_projects).to be_a Gitlab::PaginatedResponse
670 expect(@user_projects.first.id).to eq(project_id)
671 expect(@user_projects.first.owner.id).to eq(user_id)
672 end
673 end
674 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :repo_tags }
4 it { is_expected.to respond_to :repo_create_tag }
5 it { is_expected.to respond_to :repo_branches }
6 it { is_expected.to respond_to :repo_branch }
7 it { is_expected.to respond_to :repo_tree }
8 it { is_expected.to respond_to :repo_compare }
9
10 describe ".tags" do
11 before do
12 stub_get("/projects/3/repository/tags", "project_tags")
13 @tags = Gitlab.tags(3)
14 end
15
16 it "gets the correct resource" do
17 expect(a_get("/projects/3/repository/tags")).to have_been_made
18 end
19
20 it "returns a paginated response of repository tags" do
21 expect(@tags).to be_a Gitlab::PaginatedResponse
22 expect(@tags.first.name).to eq("v2.8.2")
23 end
24 end
25
26 describe ".create_tag" do
27 context "when lightweight" do
28 before do
29 stub_post("/projects/3/repository/tags", "project_tag_lightweight")
30 @tag = Gitlab.create_tag(3, 'v1.0.0', '2695effb5807a22ff3d138d593fd856244e155e7')
31 end
32
33 it "gets the correct resource" do
34 expect(a_post("/projects/3/repository/tags")).to have_been_made
35 end
36
37 it "returns information about a new repository tag" do
38 expect(@tag.name).to eq("v1.0.0")
39 expect(@tag.message).to eq(nil)
40 end
41 end
42
43 context "when annotated" do
44 before do
45 stub_post("/projects/3/repository/tags", "project_tag_annotated")
46 @tag = Gitlab.create_tag(3, 'v1.1.0', '2695effb5807a22ff3d138d593fd856244e155e7', 'Release 1.1.0')
47 end
48
49 it "gets the correct resource" do
50 expect(a_post("/projects/3/repository/tags")).to have_been_made
51 end
52
53 it "returns information about a new repository tag" do
54 expect(@tag.name).to eq("v1.1.0")
55 expect(@tag.message).to eq("Release 1.1.0")
56 end
57 end
58 end
59
60 describe ".tree" do
61 before do
62 stub_get("/projects/3/repository/tree", "tree")
63 @tree = Gitlab.tree(3)
64 end
65
66 it "gets the correct resource" do
67 expect(a_get("/projects/3/repository/tree")).to have_been_made
68 end
69
70 it "returns a paginated response of repository tree files (root level)" do
71 expect(@tree).to be_a Gitlab::PaginatedResponse
72 expect(@tree.first.name).to eq("app")
73 end
74 end
75
76 describe ".compare" do
77 before do
78 stub_get("/projects/3/repository/compare", "compare_merge_request_diff").
79 with(query: { from: "master", to: "feature" })
80 @diff = Gitlab.compare(3, 'master', 'feature')
81 end
82
83 it "gets the correct resource" do
84 expect(a_get("/projects/3/repository/compare").
85 with(query: { from: "master", to: "feature" })).to have_been_made
86 end
87
88 it "gets diffs of a merge request" do
89 expect(@diff.diffs).to be_kind_of Array
90 expect(@diff.diffs.last["new_path"]).to eq "files/js/application.js"
91 end
92 end
93 end
0 require "spec_helper"
1
2 describe Gitlab::Client do
3 describe ".file_contents" do
4 before do
5 stub_get("/projects/3/repository/files/Gemfile/raw?ref=master", "raw_file")
6 @file_contents = Gitlab.file_contents(3, "Gemfile")
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/repository/files/Gemfile/raw?ref=master")).to have_been_made
11 end
12
13 it "returns file contents" do
14 expect(@file_contents).to eq("source 'https://rubygems.org'\ngem 'rails', '4.1.2'\n")
15 end
16 end
17
18 describe ".get_file" do
19 before do
20 stub_get("/projects/3/repository/files/README%2Emd?ref=master", "get_repository_file")
21 @file = Gitlab.get_file(3, 'README.md', 'master')
22 end
23
24 it "gets the correct resource" do
25 expect(a_get("/projects/3/repository/files/README%2Emd?ref=master")).to have_been_made
26 end
27
28 it "returns the base64 encoded file" do
29 expect(@file.file_path).to eq "README.md"
30 expect(@file.ref).to eq "master"
31 expect(@file.content).to eq "VGhpcyBpcyBhICpSRUFETUUqIQ==\n"
32 end
33 end
34
35 describe ".create_file" do
36 let(:api_path) { "/projects/3/repository/files/path" }
37 let!(:request_stub) { stub_post(api_path, "repository_file") }
38 let!(:file) { Gitlab.create_file(3, "path", "branch", "content", "commit message", author_name: "joe") }
39
40 it "creates the correct resource" do
41 expected_parameters = {
42 author_name: "joe",
43 branch: "branch",
44 commit_message: "commit message"
45 }
46 expect(a_post(api_path).with(body: hash_including(expected_parameters))).to have_been_made
47 end
48
49 it "returns information about the new file" do
50 expect(file.file_path).to eq "path"
51 expect(file.branch_name).to eq "branch"
52 end
53 end
54
55 describe ".edit_file" do
56 let(:api_path) { "/projects/3/repository/files/path" }
57 let!(:request_stub) { stub_put(api_path, "repository_file") }
58 let!(:file) { Gitlab.edit_file(3, "path", "branch", "content", "commit message", author_name: "joe") }
59
60 it "updates the correct resource" do
61 expected_parameters = {
62 author_name: "joe",
63 branch: "branch",
64 commit_message: "commit message"
65 }
66 expect(a_put(api_path).with(body: hash_including(expected_parameters))).to have_been_made
67 end
68
69 it "returns information about the new file" do
70 expect(file.file_path).to eq "path"
71 expect(file.branch_name).to eq "branch"
72 end
73 end
74
75 describe ".remove_file" do
76 let(:api_path) { "/projects/3/repository/files/path" }
77 let!(:request_stub) { stub_delete(api_path, "repository_file") }
78 let!(:file) { Gitlab.remove_file(3, "path", "branch", "commit message", author_name: "joe") }
79
80 it "updates the correct resource" do
81 expected_parameters = {
82 author_name: "joe",
83 branch: "branch",
84 commit_message: "commit message"
85 }
86 expect(a_delete(api_path).with(body: hash_including(expected_parameters))).to have_been_made
87 end
88
89 it "returns information about the new file" do
90 expect(file.file_path).to eq "path"
91 expect(file.branch_name).to eq "branch"
92 end
93 end
94 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3
4 describe ".runners" do
5 before do
6 stub_get("/runners", "runners")
7 end
8
9 context 'without scope' do
10 before do
11 @runner = Gitlab.runners
12 end
13
14 it "gets the correct resource" do
15 expect(a_get("/runners")).to have_been_made
16 end
17
18 it "returns a paginated response of runners" do
19 expect(@runner).to be_a Gitlab::PaginatedResponse
20 expect(@runner.first.id).to eq(6)
21 expect(@runner.first.description).to eq('test-1-20150125')
22 end
23 end
24
25 context 'with scope' do
26 before do
27 stub_get("/runners?scope=online", "runners")
28 @runner = Gitlab.runners({scope: :online})
29 end
30
31 it "gets the correct resource" do
32 expect(a_get("/runners").with(query: { scope: :online })).to have_been_made
33 end
34
35 it "returns a paginated response of runners" do
36 expect(@runner).to be_a Gitlab::PaginatedResponse
37 expect(@runner.first.id).to eq(6)
38 expect(@runner.first.description).to eq('test-1-20150125')
39 end
40 end
41
42 end
43
44 describe ".all_runners" do
45 before do
46 stub_get("/runners/all", "runners")
47 end
48
49 context 'without scope' do
50 before do
51 @runner = Gitlab.all_runners
52 end
53
54 it "gets the correct resource" do
55 expect(a_get("/runners/all")).to have_been_made
56 end
57
58 it "returns a paginated response of runners" do
59 expect(@runner).to be_a Gitlab::PaginatedResponse
60 expect(@runner.first.id).to eq(6)
61 expect(@runner.first.description).to eq('test-1-20150125')
62 end
63 end
64
65 context 'with scope' do
66 before do
67 stub_get("/runners/all?scope=online", "runners")
68 @runner = Gitlab.all_runners({scope: :online})
69 end
70
71 it "gets the correct resource" do
72 expect(a_get("/runners/all").with(query: { scope: :online })).to have_been_made
73 end
74
75 it "returns a paginated response of runners" do
76 expect(@runner).to be_a Gitlab::PaginatedResponse
77 expect(@runner.first.id).to eq(6)
78 expect(@runner.first.description).to eq('test-1-20150125')
79 end
80 end
81 end
82
83 describe ".runner" do
84 before do
85 stub_get("/runners/6", "runner")
86 @runners = Gitlab.runner(6)
87 end
88
89 it "gets the correct resource" do
90 expect(a_get("/runners/6")).to have_been_made
91 end
92
93 it "returns a response of a runner" do
94 expect(@runners).to be_a Gitlab::ObjectifiedHash
95 expect(@runners.id).to eq(6)
96 expect(@runners.description).to eq('test-1-20150125')
97 end
98 end
99
100 describe ".update_runner" do
101 before do
102 stub_put("/runners/6", "runner_edit").with(query: { description: "abcefg" })
103 @runner = Gitlab.update_runner(6, description: "abcefg" )
104 end
105
106 it "gets the correct resource" do
107 expect(a_put("/runners/6").with(query: { description: "abcefg" })).to have_been_made
108 end
109
110 it "returns an updated response of a runner" do
111 expect(@runner).to be_a Gitlab::ObjectifiedHash
112 expect(@runner.description).to eq('abcefg')
113 end
114 end
115
116 describe ".delete_runner" do
117 before do
118 stub_delete("/runners/6", "runner_delete")
119 @runner = Gitlab.delete_runner(6)
120 end
121
122 it "gets the correct resource" do
123 expect(a_delete("/runners/6")).to have_been_made
124 end
125
126 it "returns a response of the deleted runner" do
127 expect(@runner).to be_a Gitlab::ObjectifiedHash
128 expect(@runner.id).to eq(6)
129 end
130 end
131
132 describe '.runner_jobs' do
133 before do
134 stub_get('/runners/1/jobs', 'runner_jobs')
135 @jobs = Gitlab.runner_jobs(1)
136 end
137 it 'gets the correct resource' do
138 expect(a_get('/runners/1/jobs')).to have_been_made
139 end
140 end
141
142 describe ".project_runners" do
143 before do
144 stub_get("/projects/1/runners", "project_runners")
145 @runners = Gitlab.project_runners(1)
146 end
147
148 it "gets the correct resource" do
149 expect(a_get("/projects/1/runners")).to have_been_made
150 end
151
152 it "returns a paginated response of runners" do
153 expect(@runners).to be_a Gitlab::PaginatedResponse
154 expect(@runners.first.id).to eq(8)
155 expect(@runners.first.description).to eq('test-2-20150125')
156 end
157 end
158
159 describe ".project_enable_runner" do
160 before do
161 stub_post("/projects/1/runners", "runner")
162 @runner = Gitlab.project_enable_runner(1, 6)
163 end
164
165 it "gets the correct resource" do
166 expect(a_post("/projects/1/runners")).to have_been_made
167 end
168
169 it "returns a response of the enabled runner" do
170 expect(@runner).to be_a Gitlab::ObjectifiedHash
171 expect(@runner.id).to eq(6)
172 expect(@runner.description).to eq('test-1-20150125')
173 end
174 end
175
176 describe ".project_disable_runner" do
177 before do
178 stub_delete("/projects/1/runners/6", "runner")
179 @runner = Gitlab.project_disable_runner(1, 6)
180 end
181
182 it "gets the correct resource" do
183 expect(a_delete("/projects/1/runners/6")).to have_been_made
184 end
185
186 it "returns a response of the disabled runner" do
187 expect(@runner).to be_a Gitlab::ObjectifiedHash
188 expect(@runner.id).to eq(6)
189 expect(@runner.description).to eq('test-1-20150125')
190 end
191 end
192 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".service" do
4 before do
5 stub_get("/projects/3/services/redmine", "service")
6 @service = Gitlab.service(3, :redmine)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/services/redmine")).to have_been_made
11 end
12
13 it "returns a information about a service of project" do
14 expect(@service.id).to eq 38
15 expect(@service.title).to eq("Redmine")
16 expect(@service.properties.project_url).to eq("https://example.com/projects/test_project/issue")
17 end
18 end
19
20 describe ".change_service" do
21 before do
22 stub_put("/projects/3/services/redmine", "service")
23 @service = Gitlab.change_service(3, :redmine, new_issue_url: 'https://example.com/projects/test_project/issues/new',
24 project_url: 'https://example.com/projects/test_project/issues',
25 issues_url: 'https://example.com/issues/:id')
26 end
27
28 it "gets the correct resource" do
29 body = {new_issue_url: 'https://example.com/projects/test_project/issues/new',
30 project_url: 'https://example.com/projects/test_project/issues',
31 issues_url: 'https://example.com/issues/:id'}
32 expect(a_put("/projects/3/services/redmine").with(body: body)).to have_been_made
33 end
34
35 it "returns information about a new service" do
36 expect(@service).to be_truthy
37 end
38 end
39
40 describe ".delete_servoce" do
41 before do
42 stub_delete("/projects/3/services/redmine", "service")
43 @service = Gitlab.delete_service(3, :redmine)
44 end
45
46 it "gets the correct resource" do
47 expect(a_delete("/projects/3/services/redmine")).to have_been_made
48 end
49
50 it "returns information about a deleted service" do
51 expect(@service).to be_truthy
52 end
53 end
54 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".sidekiq_queue_metrics" do
4 before do
5 stub_get("/sidekiq/queue_metrics", 'sidekiq_queue_metrics')
6 @sidekiq_queue_metrics = Gitlab.sidekiq_queue_metrics
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/sidekiq/queue_metrics")).to have_been_made
11 end
12
13 it "returns a information about a sidekiq default queue" do
14 expect(@sidekiq_queue_metrics.queues.default.backlog).to eq 0
15 expect(@sidekiq_queue_metrics.queues.default.latency).to eq 0
16 end
17 end
18
19 describe ".sidekiq_process_metrics" do
20 before do
21 stub_get("/sidekiq/process_metrics", 'sidekiq_process_metrics')
22 @sidekiq_process_metrics = Gitlab.sidekiq_process_metrics
23 end
24
25 it "gets the correct resource" do
26 expect(a_get("/sidekiq/process_metrics")).to have_been_made
27 end
28
29 it "returns a information about a sidekiq process metrics" do
30 expect(@sidekiq_process_metrics.processes.first['busy']).to eq 0
31 end
32 end
33
34 describe ".sidekiq_job_stats" do
35 before do
36 stub_get("/sidekiq/job_stats", 'sidekiq_job_stats')
37 @sidekiq_job_stats = Gitlab.sidekiq_job_stats
38 end
39
40 it "gets the correct resource" do
41 expect(a_get("/sidekiq/job_stats")).to have_been_made
42 end
43
44 it "returns a information about a sidekiq process metrics" do
45 expect(@sidekiq_job_stats.jobs.processed).to eq 2
46 end
47 end
48
49 describe ".sidekiq_compound_metrics" do
50 before do
51 stub_get("/sidekiq/compound_metrics", 'sidekiq_compound_metrics')
52 @sidekiq_compound_metrics = Gitlab.sidekiq_compound_metrics
53 end
54
55 it "gets the correct resource" do
56 expect(a_get("/sidekiq/compound_metrics")).to have_been_made
57 end
58
59 it "returns a information about a sidekiq process metrics" do
60 expect(@sidekiq_compound_metrics.jobs.processed).to eq 2
61 end
62 end
63 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".snippets" do
4 before do
5 stub_get("/projects/3/snippets", "snippets")
6 @snippets = Gitlab.snippets(3)
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/projects/3/snippets")).to have_been_made
11 end
12
13 it "returns a paginated response of project's snippets" do
14 expect(@snippets).to be_a Gitlab::PaginatedResponse
15 expect(@snippets.first.file_name).to eq("mailer_test.rb")
16 end
17 end
18
19 describe ".snippet" do
20 before do
21 stub_get("/projects/3/snippets/1", "snippet")
22 @snippet = Gitlab.snippet(3, 1)
23 end
24
25 it "gets the correct resource" do
26 expect(a_get("/projects/3/snippets/1")).to have_been_made
27 end
28
29 it "returns information about a snippet" do
30 expect(@snippet.file_name).to eq("mailer_test.rb")
31 expect(@snippet.author.name).to eq("John Smith")
32 end
33 end
34
35 describe ".create_snippet" do
36 before do
37 stub_post("/projects/3/snippets", "snippet")
38 @snippet = Gitlab.create_snippet(3, title: 'API', file_name: 'api.rb', code: 'code', visibility: 'public')
39 end
40
41 it "gets the correct resource" do
42 body = { title: 'API', file_name: 'api.rb', code: 'code', visibility: 'public' }
43 expect(a_post("/projects/3/snippets").with(body: body)).to have_been_made
44 end
45
46 it "returns information about a new snippet" do
47 expect(@snippet.file_name).to eq("mailer_test.rb")
48 expect(@snippet.author.name).to eq("John Smith")
49 end
50 end
51
52 describe ".edit_snippet" do
53 before do
54 stub_put("/projects/3/snippets/1", "snippet")
55 @snippet = Gitlab.edit_snippet(3, 1, file_name: 'mailer_test.rb')
56 end
57
58 it "gets the correct resource" do
59 expect(a_put("/projects/3/snippets/1").
60 with(body: { file_name: 'mailer_test.rb' })).to have_been_made
61 end
62
63 it "returns information about an edited snippet" do
64 expect(@snippet.file_name).to eq("mailer_test.rb")
65 expect(@snippet.author.name).to eq("John Smith")
66 end
67 end
68
69 describe ".delete_snippet" do
70 before do
71 stub_delete("/projects/3/snippets/1", "snippet")
72 @snippet = Gitlab.delete_snippet(3, 1)
73 end
74
75 it "gets the correct resource" do
76 expect(a_delete("/projects/3/snippets/1")).to have_been_made
77 end
78
79 it "returns information about a deleted snippet" do
80 expect(@snippet.file_name).to eq("mailer_test.rb")
81 expect(@snippet.author.name).to eq("John Smith")
82 end
83 end
84
85 describe ".snippet_content" do
86 before do
87 stub_get("/projects/3/snippets/1/raw", "snippet_content")
88 @snippet_content = Gitlab.snippet_content(3, 1)
89 end
90
91 it "gets the correct resource" do
92 expect(a_get("/projects/3/snippets/1/raw")).to have_been_made
93 end
94
95 it "returns raw content of a snippet" do
96 expect(@snippet_content).to eq("#!/usr/bin/env ruby\n\nputs \"Cool snippet!\"\n")
97 end
98 end
99 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :system_hooks }
4 it { is_expected.to respond_to :add_system_hook }
5 it { is_expected.to respond_to :system_hook }
6 it { is_expected.to respond_to :delete_system_hook }
7
8 describe ".hooks" do
9 before do
10 stub_get("/hooks", "system_hooks")
11 @hooks = Gitlab.hooks
12 end
13
14 it "gets the correct resource" do
15 expect(a_get("/hooks")).to have_been_made
16 end
17
18 it "returns a paginated response of system hooks" do
19 expect(@hooks).to be_a Gitlab::PaginatedResponse
20 expect(@hooks.first.url).to eq("http://example.com/hook")
21 end
22 end
23
24 describe ".add_hook" do
25 before do
26 stub_post("/hooks", "system_hook")
27 @hook = Gitlab.add_hook("http://example.com/hook", token: 'secret-token')
28 end
29
30 it "gets the correct resource" do
31 expect(a_post("/hooks").with(body: hash_including(token: 'secret-token'))).to have_been_made
32 end
33
34 it "returns information about a added system hook" do
35 expect(@hook.url).to eq("http://example.com/hook")
36 end
37 end
38
39 describe ".hook" do
40 before do
41 stub_get("/hooks/3", "system_hook")
42 @hook = Gitlab.hook(3)
43 end
44
45 it "gets the correct resource" do
46 expect(a_get("/hooks/3")).to have_been_made
47 end
48
49 it "returns information about a added system hook" do
50 expect(@hook.url).to eq("http://example.com/hook")
51 end
52 end
53
54 describe ".delete_hook" do
55 before do
56 stub_delete("/hooks/3", "system_hook")
57 @hook = Gitlab.delete_hook(3)
58 end
59
60 it "gets the correct resource" do
61 expect(a_delete("/hooks/3")).to have_been_made
62 end
63
64 it "returns information about a deleted system hook" do
65 expect(@hook.url).to eq("http://example.com/hook")
66 end
67 end
68 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 it { is_expected.to respond_to :repo_tags }
4 it { is_expected.to respond_to :repo_tag }
5 it { is_expected.to respond_to :repo_create_tag }
6 it { is_expected.to respond_to :repo_delete_tag }
7 it { is_expected.to respond_to :repo_create_release }
8 it { is_expected.to respond_to :repo_update_release }
9
10 describe '.tags' do
11 before do
12 stub_get("/projects/3/repository/tags", "tags")
13 @tags = Gitlab.tags(3)
14 end
15
16 it "gets the correct resource" do
17 expect(a_get("/projects/3/repository/tags")).to have_been_made
18 end
19
20 it "returns a paginated response of repository tags" do
21 expect(@tags).to be_a Gitlab::PaginatedResponse
22 expect(@tags.map(&:name)).to eq(%w[0.0.2 0.0.1])
23 end
24 end
25
26 describe ".tag" do
27 before do
28 stub_get("/projects/3/repository/tags/0.0.1", "tag")
29 @tag = Gitlab.tag(3, "0.0.1")
30 end
31
32 it "gets the correct resource" do
33 expect(a_get("/projects/3/repository/tags/0.0.1")).to have_been_made
34 end
35
36 it "returns information about a repository tag" do
37 expect(@tag.name).to eq("0.0.1")
38 end
39
40 context "tag with special character" do
41 before do
42 stub_get("/projects/3/repository/tags/test%2Fme", "tag")
43 @tag = Gitlab.tag(3, "test/me")
44 end
45
46 it "gets the correct resource" do
47 expect(a_get("/projects/3/repository/tags/test%2Fme")).to have_been_made
48 end
49 end
50 end
51
52 describe ".create_tag" do
53 before do
54 stub_post("/projects/3/repository/tags", "tag_create")
55 @tag = Gitlab.create_tag(3, "0.0.1", "master", 'this tag is annotated', 'and it has release notes')
56 end
57
58 it "gets the correct resource" do
59 expect(a_post("/projects/3/repository/tags")).to have_been_made
60 end
61
62 it "returns information about a new repository tag" do
63 expect(@tag.name).to eq("0.0.1")
64 expect(@tag.message).to eq('this tag is annotated')
65 end
66
67 it "returns detailed information" do
68 expect(@tag.release.description).to eq('and it has release notes')
69 end
70 end
71
72 describe ".delete_tag" do
73 before do
74 stub_delete("/projects/3/repository/tags/0.0.1", "tag_delete")
75 @tag = Gitlab.delete_tag(3, "0.0.1")
76 end
77
78 it "gets the correct resource" do
79 expect(a_delete("/projects/3/repository/tags/0.0.1")).to have_been_made
80 end
81
82 it "returns information about the deleted repository tag" do
83 expect(@tag.tag_name).to eq("0.0.1")
84 end
85
86 context "tag with special character" do
87 before do
88 stub_delete("/projects/3/repository/tags/test%2Fme", "tag_delete")
89 @tag = Gitlab.delete_tag(3, "test/me")
90 end
91
92 it "gets the correct resource" do
93 expect(a_delete("/projects/3/repository/tags/test%2Fme")).to have_been_made
94 end
95 end
96 end
97
98 describe ".create_release" do
99 before do
100 stub_post("/projects/3/repository/tags/0.0.1/release", "release_create")
101 @tag = Gitlab.create_release(3, "0.0.1", "Amazing release. Wow")
102 end
103
104 it "gets the correct resource" do
105 expect(a_post("/projects/3/repository/tags/0.0.1/release")).to have_been_made
106 end
107
108 it "returns information about the tag and the release" do
109 expect(@tag.tag_name).to eq("0.0.1")
110 expect(@tag.description).to eq("Amazing release. Wow")
111 end
112
113 context "tag with special character" do
114 before do
115 stub_post("/projects/3/repository/tags/test%2Fme/release", "release_create")
116 @tag = Gitlab.create_release(3, "test/me", "Amazing release. Wow")
117 end
118
119 it "gets the correct resource" do
120 expect(a_post("/projects/3/repository/tags/test%2Fme/release")).to have_been_made
121 end
122 end
123 end
124
125 describe ".update_release" do
126 before do
127 stub_put("/projects/3/repository/tags/0.0.1/release", "release_update")
128 @tag = Gitlab.update_release(3, "0.0.1", 'Amazing release. Wow')
129 end
130
131 it "updates the correct resource" do
132 expect(a_put("/projects/3/repository/tags/0.0.1/release")).to have_been_made
133 end
134
135 it "returns information about the tag" do
136 expect(@tag.tag_name).to eq("0.0.1")
137 expect(@tag.description).to eq('Amazing release. Wow')
138 end
139
140 context "tag with special character" do
141 before do
142 stub_put("/projects/3/repository/tags/test%2Fme/release", "release_update")
143 @tag = Gitlab.update_release(3, "test/me", 'Amazing release. Wow')
144 end
145
146 it "updates the correct resource" do
147 expect(a_put("/projects/3/repository/tags/test%2Fme/release")).to have_been_made
148 end
149 end
150 end
151 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe '.todos' do
4 before do
5 stub_get("/todos", "todos")
6 @todos = Gitlab.todos
7 end
8
9 it "gets the correct resources" do
10 expect(a_get("/todos")).to have_been_made
11 end
12
13 it "returns a paginated response of user's todos" do
14 expect(@todos).to be_a Gitlab::PaginatedResponse
15 end
16 end
17
18 describe '.mark_todo_as_done' do
19 before do
20 stub_post("/todos/102/mark_as_done", "todo")
21 @todo = Gitlab.mark_todo_as_done(102)
22 end
23
24 it "gets the correct resource" do
25 expect(a_post("/todos/102/mark_as_done")).to have_been_made
26 end
27
28 it "returns information about the todo marked as done" do
29 expect(@todo.id).to eq(102)
30 expect(@todo.state).to eq('done')
31 end
32 end
33
34 describe '.mark_all_todos_as_done' do
35 before do
36 stub_post("/todos/mark_as_done", "todos")
37 @todos = Gitlab.mark_all_todos_as_done
38 end
39
40 it "gets the correct resources" do
41 expect(a_post("/todos/mark_as_done")).to have_been_made
42 end
43 end
44 end
0 require 'spec_helper'
1
2 describe Gitlab::Client do
3 describe ".users" do
4 before do
5 stub_get("/users", "users")
6 @users = Gitlab.users
7 end
8
9 it "gets the correct resource" do
10 expect(a_get("/users")).to have_been_made
11 end
12
13 it "returns a paginated response of users" do
14 expect(@users).to be_a Gitlab::PaginatedResponse
15 expect(@users.first.email).to eq("john@example.com")
16 end
17 end
18
19 describe ".user" do
20 context "with user ID passed" do
21 before do
22 stub_get("/users/1", "user")
23 @user = Gitlab.user(1)
24 end
25
26 it "gets the correct resource" do
27 expect(a_get("/users/1")).to have_been_made
28 end
29
30 it "returns information about a user" do
31 expect(@user.email).to eq("john@example.com")
32 end
33 end
34
35 context "without user ID passed" do
36 before do
37 stub_get("/user", "user")
38 @user = Gitlab.user
39 end
40
41 it "gets the correct resource" do
42 expect(a_get("/user")).to have_been_made
43 end
44
45 it "returns information about an authorized user" do
46 expect(@user.email).to eq("john@example.com")
47 end
48 end
49 end
50
51 describe ".create_user" do
52 context "when successful request" do
53 before do
54 stub_post("/users", "user")
55 @user = Gitlab.create_user("email", "pass")
56 end
57
58 it "gets the correct resource" do
59 body = { email: "email", password: "pass", name: "email" }
60 expect(a_post("/users").with(body: body)).to have_been_made
61 end
62
63 it "returns information about a created user" do
64 expect(@user.email).to eq("john@example.com")
65 end
66 end
67
68 context "when bad request" do
69 it "throws an exception" do
70 stub_post("/users", "error_already_exists", 409)
71 expect do
72 Gitlab.create_user("email", "pass")
73 end.to raise_error(Gitlab::Error::Conflict, "Server responded with code 409, message: 409 Already exists. Request URI: #{Gitlab.endpoint}/users")
74 end
75 end
76 end
77
78 describe ".create_user_with_userame" do
79 context "when successful request" do
80 before do
81 stub_post("/users", "user")
82 @user = Gitlab.create_user("email", "pass", "username")
83 end
84
85 it "gets the correct resource" do
86 body = { email: "email", password: "pass", username: "username" }
87 expect(a_post("/users").with(body: body)).to have_been_made
88 end
89
90 it "returns information about a created user" do
91 expect(@user.email).to eq("john@example.com")
92 end
93 end
94
95 context "when bad request" do
96 it "throws an exception" do
97 stub_post("/users", "error_already_exists", 409)
98 expect do
99 Gitlab.create_user("email", "pass", "username")
100 end.to raise_error(Gitlab::Error::Conflict, "Server responded with code 409, message: 409 Already exists. Request URI: #{Gitlab.endpoint}/users")
101 end
102 end
103 end
104
105 describe ".edit_user" do
106 before do
107 @options = { name: "Roberto" }
108 stub_put("/users/1", "user").with(body: @options)
109 @user = Gitlab.edit_user(1, @options)
110 end
111
112 it "gets the correct resource" do
113 expect(a_put("/users/1").with(body: @options)).to have_been_made
114 end
115 end
116
117 describe ".delete_user" do
118 before do
119 stub_delete("/users/1", "user")
120 @user = Gitlab.delete_user(1)
121 end
122
123 it "gets the correct resource" do
124 expect(a_delete("/users/1")).to have_been_made
125 end
126
127 it "returns information about a deleted user" do
128 expect(@user.email).to eq("john@example.com")
129 end
130 end
131
132 describe ".block_user" do
133 before do
134 stub_post("/users/1/block", "user_block_unblock")
135 @result = Gitlab.block_user(1)
136 end
137
138 it "gets the correct resource" do
139 expect(a_post("/users/1/block")).to have_been_made
140 end
141
142 it "returns boolean" do
143 expect(@result).to eq(true)
144 end
145 end
146
147 describe ".unblock_user" do
148 before do
149 stub_post("/users/1/unblock", "user_block_unblock")
150 @result = Gitlab.unblock_user(1)
151 end
152
153 it "gets the correct resource" do
154 expect(a_post("/users/1/unblock")).to have_been_made
155 end
156
157 it "returns boolean" do
158 expect(@result).to eq(true)
159 end
160 end
161
162 describe ".session" do
163 after do
164 Gitlab.endpoint = 'https://api.example.com'
165 Gitlab.private_token = 'secret'
166 end
167
168 before do
169 stub_request(:post, "#{Gitlab.endpoint}/session").
170 to_return(body: load_fixture('session'), status: 200)
171 @session = Gitlab.session("email", "pass")
172 end
173
174 context "when endpoint is not set" do
175 it "raises Error::MissingCredentials" do
176 Gitlab.endpoint = nil
177 expect do
178 Gitlab.session("email", "pass")
179 end.to raise_error(Gitlab::Error::MissingCredentials, 'Please set an endpoint to API')
180 end
181 end
182
183 context "when private_token is not set" do
184 it "does not raise Error::MissingCredentials" do
185 Gitlab.private_token = nil
186 expect { Gitlab.session("email", "pass") }.to_not raise_error
187 end
188 end
189
190 context "when endpoint is set" do
191 it "gets the correct resource" do
192 expect(a_request(:post, "#{Gitlab.endpoint}/session")).to have_been_made
193 end
194
195 it "returns information about a created session" do
196 expect(@session.email).to eq("john@example.com")
197 expect(@session.private_token).to eq("qEsq1pt6HJPaNciie3MG")
198 end
199 end
200 end
201
202 describe ".ssh_keys" do
203 context "with user ID passed" do
204 before do
205 stub_get("/users/1/keys", "keys")
206 @keys = Gitlab.ssh_keys({ user_id: 1 })
207 end
208
209 it "gets the correct resource" do
210 expect(a_get("/users/1/keys")).to have_been_made
211 end
212
213 it "returns a paginated response of SSH keys" do
214 expect(@keys).to be_a Gitlab::PaginatedResponse
215 expect(@keys.first.title).to eq("narkoz@helium")
216 end
217 end
218
219 context "without user ID passed" do
220 before do
221 stub_get("/user/keys", "keys")
222 @keys = Gitlab.ssh_keys
223 end
224
225 it "gets the correct resource" do
226 expect(a_get("/user/keys")).to have_been_made
227 end
228
229 it "returns a paginated response of SSH keys" do
230 expect(@keys).to be_a Gitlab::PaginatedResponse
231 expect(@keys.first.title).to eq("narkoz@helium")
232 end
233 end
234 end
235
236 describe ".ssh_key" do
237 before do
238 stub_get("/user/keys/1", "key")
239 @key = Gitlab.ssh_key(1)
240 end
241
242 it "gets the correct resource" do
243 expect(a_get("/user/keys/1")).to have_been_made
244 end
245
246 it "returns information about an SSH key" do
247 expect(@key.title).to eq("narkoz@helium")
248 end
249 end
250
251 describe ".create_ssh_key" do
252 before do
253 stub_post("/user/keys", "key")
254 @key = Gitlab.create_ssh_key("title", "body")
255 end
256
257 it "gets the correct resource" do
258 body = { title: "title", key: "body" }
259 expect(a_post("/user/keys").with(body: body)).to have_been_made
260 end
261
262 it "returns information about a created SSH key" do
263 expect(@key.title).to eq("narkoz@helium")
264 end
265 end
266
267 describe ".delete_ssh_key" do
268 before do
269 stub_delete("/user/keys/1", "key")
270 @key = Gitlab.delete_ssh_key(1)
271 end
272
273 it "gets the correct resource" do
274 expect(a_delete("/user/keys/1")).to have_been_made
275 end
276
277 it "returns information about a deleted SSH key" do
278 expect(@key.title).to eq("narkoz@helium")
279 end
280 end
281
282 describe ".emails" do
283 describe "without user ID" do
284 before do
285 stub_get("/user/emails", "user_emails")
286 @emails = Gitlab.emails
287 end
288
289 it "gets the correct resource" do
290 expect(a_get("/user/emails")).to have_been_made
291 end
292
293 it "returns a information about a emails of user" do
294 email = @emails.first
295 expect(email.id).to eq 1
296 expect(email.email).to eq("email@example.com")
297 end
298 end
299
300 describe "with user ID" do
301 before do
302 stub_get("/users/2/emails", "user_emails")
303 @emails = Gitlab.emails(2)
304 end
305
306 it "gets the correct resource" do
307 expect(a_get("/users/2/emails")).to have_been_made
308 end
309
310 it "returns a information about a emails of user" do
311 email = @emails.first
312 expect(email.id).to eq 1
313 expect(email.email).to eq("email@example.com")
314 end
315 end
316 end
317
318 describe ".email" do
319 before do
320 stub_get("/user/emails/2", "user_email")
321 @email = Gitlab.email(2)
322 end
323
324 it "gets the correct resource" do
325 expect(a_get("/user/emails/2")).to have_been_made
326 end
327
328 it "returns a information about a email of user" do
329 expect(@email.id).to eq 1
330 expect(@email.email).to eq("email@example.com")
331 end
332 end
333
334 describe ".add_email" do
335 describe "without user ID" do
336 before do
337 stub_post("/user/emails", "user_email")
338 @email = Gitlab.add_email("email@example.com")
339 end
340
341 it "gets the correct resource" do
342 body = { email: "email@example.com" }
343 expect(a_post("/user/emails").with(body: body)).to have_been_made
344 end
345
346 it "returns information about a new email" do
347 expect(@email.id).to eq(1)
348 expect(@email.email).to eq("email@example.com")
349 end
350 end
351
352 describe "with user ID" do
353 before do
354 stub_post("/users/2/emails", "user_email")
355 @email = Gitlab.add_email("email@example.com", 2)
356 end
357
358 it "gets the correct resource" do
359 body = { email: "email@example.com" }
360 expect(a_post("/users/2/emails").with(body: body)).to have_been_made
361 end
362
363 it "returns information about a new email" do
364 expect(@email.id).to eq(1)
365 expect(@email.email).to eq("email@example.com")
366 end
367 end
368 end
369
370 describe ".delete_email" do
371 describe "without user ID" do
372 before do
373 stub_delete("/user/emails/1", "user_email")
374 @email = Gitlab.delete_email(1)
375 end
376
377 it "gets the correct resource" do
378 expect(a_delete("/user/emails/1")).to have_been_made
379 end
380
381 it "returns information about a deleted email" do
382 expect(@email).to be_truthy
383 end
384 end
385
386 describe "with user ID" do
387 before do
388 stub_delete("/users/2/emails/1", "user_email")
389 @email = Gitlab.delete_email(1, 2)
390 end
391
392 it "gets the correct resource" do
393 expect(a_delete("/users/2/emails/1")).to have_been_made
394 end
395
396 it "returns information about a deleted email" do
397 expect(@email).to be_truthy
398 end
399 end
400 end
401
402 describe ".user_search" do
403 before do
404 stub_get("/users?search=User", "user_search")
405 @users = Gitlab.user_search('User')
406 end
407
408 it "gets the correct resource" do
409 expect(a_get("/users?search=User")).to have_been_made
410 end
411
412 it "returns an array of users found" do
413 expect(@users.first.id).to eq(1)
414 expect(@users.last.id).to eq(2)
415 end
416 end
417 end
0 require 'spec_helper'
1
2 describe Gitlab::Error::ResponseError do
3 before do
4 @request_double = double(base_uri: 'https://gitlab.com/api/v3', path: '/foo')
5 end
6
7 let(:expected_messages) do
8 [
9 %r{Server responded with code \d+, message: Displayed message. Request URI: https://gitlab.com/api/v3/foo},
10 %r{Server responded with code \d+, message: Displayed error_description. Request URI: https://gitlab.com/api/v3/foo},
11 %r{Server responded with code \d+, message: Displayed error. Request URI: https://gitlab.com/api/v3/foo},
12 %r{Server responded with code \d+, message: 'embed_entity' \(foo: bar\) \(sna: fu\), 'password' too short. Request URI: https://gitlab.com/api/v3/foo},
13 %r{Server responded with code \d+, message: First message. Second message.. Request URI: https://gitlab.com/api/v3/foo},
14 ]
15 end
16
17 # Set up some response scenarios to test.
18 [
19 { code: 401, parsed_response: Gitlab::ObjectifiedHash.new(message: 'Displayed message', error_description: 'should not be displayed', error: 'also will not be displayed')},
20 { code: 404, parsed_response: Gitlab::ObjectifiedHash.new(error_description: 'Displayed error_description', error: 'also will not be displayed')},
21 { code: 401, parsed_response: Gitlab::ObjectifiedHash.new(error: 'Displayed error')},
22 { code: 500, parsed_response: Gitlab::ObjectifiedHash.new(embed_entity: { foo: ['bar'], sna: ['fu']}, password: ['too short'])},
23 { code: 403, parsed_response: Array.new(['First message.', 'Second message.'])},
24 ].each_with_index do |data, index|
25 it 'returns the expected message' do
26 response_double = double(**data, request: @request_double)
27 expect(described_class.new(response_double).message).to match expected_messages[index]
28 end
29 end
30 end
0 require 'spec_helper'
1
2 describe Gitlab::FileResponse do
3 before do
4 @file_response = Gitlab::FileResponse.new StringIO.new("", 'rb+')
5 end
6
7 context '.empty?' do
8 it "returns false" do
9 expect(@file_response.empty?).to be false
10 end
11 end
12
13 context '.to_hash' do
14 it "has `filename` key and `data` key" do
15 h = @file_response.to_hash
16 expect(h.key?(:filename)).to be_truthy
17 expect(h.key?(:data)).to be_truthy
18 end
19 end
20
21 context '.parse_headers!' do
22 it "parses headers" do
23 @file_response.parse_headers!('Content-Disposition' => 'attachment; filename=artifacts.zip')
24 expect(@file_response.filename).to eq "artifacts.zip"
25 end
26
27 it "handles quoted filenames" do
28 @file_response.parse_headers!('Content-Disposition' => 'attachment; filename="artifacts.zip"')
29 expect(@file_response.filename).to eq "artifacts.zip"
30 end
31 end
32 end
0 require 'spec_helper'
1
2 describe Gitlab::Help do
3 describe ".ri_cmd" do
4 context "ri command found" do
5 it "returns the path to RI" do
6 allow(Gitlab::Help).to receive(:`).with(/which ri/).and_return('/usr/bin/ri')
7 expect(Gitlab::Help.ri_cmd).to eq('/usr/bin/ri')
8 end
9 end
10
11 context "ri command NOT found" do
12 it "raises RuntimeError" do
13 allow(Gitlab::Help).to receive(:`).with(/which ri/).and_return('')
14 expect { Gitlab::Help.ri_cmd }.to raise_error RuntimeError
15 end
16 end
17 end
18
19 describe ".change_help_output!" do
20 before do
21 @cmd = "create_branch"
22 @help_output = "Gitlab.#{@cmd}(4, 'new-branch', 'master')"
23 @help_output_with_options = "Gitlab.groups({ per_page: 3 })"
24 end
25 it "returns a String of modified output" do
26 Gitlab::Help.change_help_output! @cmd, @help_output
27 expect(@help_output).to eq("Gitlab.create_branch 4 'new-branch' 'master'")
28 end
29 it "formats options hash and return a String of modified output" do
30 Gitlab::Help.change_help_output! 'groups', @help_output_with_options
31 expect(@help_output_with_options).to eq("Gitlab.groups \"{ per_page: 3 }\"")
32 end
33 end
34
35 describe ".namespace" do
36 before do
37 @cmd = 'create_tag'
38 @namespace = Gitlab::Help.namespace @cmd
39 end
40 it "returns the full namespace for a command" do
41 expect(@namespace).to be_a String
42 expect(@namespace).to eq("Gitlab::Client::Tags.#{@cmd}")
43 end
44 end
45 end
0 require 'spec_helper'
1
2 describe Gitlab::ObjectifiedHash do
3 before do
4 @hash = { a: 1, b: 2, 'string' => 'string', symbol: :symbol }
5 @oh = Gitlab::ObjectifiedHash.new @hash
6 end
7
8 it "objectifies a hash" do
9 expect(@oh.a).to eq(@hash[:a])
10 expect(@oh.b).to eq(@hash[:b])
11 end
12
13 describe "#to_hash" do
14 it "returns an original hash" do
15 expect(@oh.to_hash).to eq(@hash)
16 end
17
18 it "has an alias #to_h" do
19 expect(@oh.respond_to?(:to_h)).to be_truthy
20 end
21 end
22
23 describe "#inspect" do
24 it "returns a formatted string" do
25 pretty_string = "#<#{@oh.class.name}:#{@oh.object_id} {hash: #{@hash}}"
26 expect(@oh.inspect).to eq(pretty_string)
27 end
28 end
29
30 describe "#respond_to" do
31 it "returns true for methods this object responds to through method_missing as sym" do
32 expect(@oh.respond_to?(:a)).to be_truthy
33 end
34
35 it "returns true for methods this object responds to through method_missing as string" do
36 expect(@oh.respond_to?('string')).to be_truthy
37 end
38
39 it "does not care if you use a string or symbol to reference a method" do
40 expect(@oh.respond_to?(:string)).to be_truthy
41 end
42
43 it "does not care if you use a string or symbol to reference a method" do
44 expect(@oh.respond_to?('symbol')).to be_truthy
45 end
46 end
47 end
0 require 'spec_helper'
1
2 describe Gitlab::PageLinks do
3 before do
4 @page_links = Gitlab::PageLinks.new('Link' => "<http://example.com/api/v3/projects?page=1&per_page=5>; rel=\"first\", <http://example.com/api/v3/projects?page=20&per_page=5>; rel=\"last\", <http://example.com/api/v3/projects?page=7&per_page=5>; rel=\"prev\", <http://example.com/api/v3/projects?page=9&per_page=5>; rel=\"next\"")
5 end
6
7 context '.extract_links' do
8 it 'extracts link header appropriately' do
9 expect(@page_links.last).to eql 'http://example.com/api/v3/projects?page=20&per_page=5'
10 expect(@page_links.first).to eql 'http://example.com/api/v3/projects?page=1&per_page=5'
11 expect(@page_links.next).to eql 'http://example.com/api/v3/projects?page=9&per_page=5'
12 expect(@page_links.prev).to eql 'http://example.com/api/v3/projects?page=7&per_page=5'
13 end
14 end
15 end
0 require 'spec_helper'
1
2 describe Gitlab::PaginatedResponse do
3 before do
4 array = [1, 2, 3, 4]
5 @paginated_response = Gitlab::PaginatedResponse.new array
6 end
7
8 it "responds to *_page and has_*_page methods" do
9 expect(@paginated_response).to respond_to :first_page
10 expect(@paginated_response).to respond_to :last_page
11 expect(@paginated_response).to respond_to :next_page
12 expect(@paginated_response).to respond_to :prev_page
13 expect(@paginated_response).to respond_to :has_first_page?
14 expect(@paginated_response).to respond_to :has_last_page?
15 expect(@paginated_response).to respond_to :has_next_page?
16 expect(@paginated_response).to respond_to :has_prev_page?
17 end
18
19 context '.parse_headers!' do
20 it "parses headers" do
21 @paginated_response.parse_headers!('Link' => "<http://example.com/api/v3/projects?page=1&per_page=5>; rel=\"first\", <http://example.com/api/v3/projects?page=20&per_page=5>; rel=\"last\"")
22 client = @paginated_response.client = double('client')
23 first_page_response = double('first_page_response')
24 last_page_response = double('last_page_response')
25 allow(client).to receive(:endpoint).and_return("http://example.com/api/v3")
26 allow(client).to receive(:get).with("/projects?page=1&per_page=5").and_return(first_page_response)
27 allow(client).to receive(:get).with("/projects?page=20&per_page=5").and_return(last_page_response)
28 expect(@paginated_response.has_first_page?).to be true
29 expect(@paginated_response.has_last_page?).to be true
30 expect(@paginated_response.has_next_page?).to be false
31 expect(@paginated_response.has_prev_page?).to be false
32 expect(@paginated_response.first_page).to be first_page_response
33 expect(@paginated_response.last_page).to be last_page_response
34 expect(@paginated_response.next_page).to be_nil
35 expect(@paginated_response.prev_page).to be_nil
36 end
37 end
38
39 context '.each_page' do
40 it "iterates pages" do
41 next_page = double('next_page')
42 allow(@paginated_response).to receive(:has_next_page?).and_return(true)
43 allow(@paginated_response).to receive(:next_page).and_return(next_page)
44 allow(next_page).to receive(:has_next_page?).and_return(false)
45 expect { |b| @paginated_response.each_page(&b) }.to yield_successive_args(@paginated_response, next_page)
46 end
47 end
48
49 context '.auto_paginate' do
50 it "returns an array if block is not given" do
51 next_page = double('next_page')
52 allow(@paginated_response).to receive(:has_next_page?).and_return(true)
53 allow(@paginated_response).to receive(:next_page).and_return(next_page)
54 allow(next_page).to receive(:has_next_page?).and_return(false)
55 allow(next_page).to receive(:to_ary).and_return([5, 6, 7, 8])
56 expect(@paginated_response.auto_paginate).to contain_exactly(1, 2, 3, 4, 5, 6, 7, 8)
57 end
58 end
59 end
0 require 'spec_helper'
1
2 describe Gitlab::Request do
3 it { is_expected.to respond_to :get }
4 it { is_expected.to respond_to :post }
5 it { is_expected.to respond_to :put }
6 it { is_expected.to respond_to :delete }
7 before do
8 @request = Gitlab::Request.new
9 end
10
11 describe ".default_options" do
12 it "has default values" do
13 default_options = Gitlab::Request.default_options
14 expect(default_options).to be_a Hash
15 expect(default_options[:parser]).to be_a Proc
16 expect(default_options[:format]).to eq(:json)
17 expect(default_options[:headers]).to eq('Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded')
18 expect(default_options[:default_params]).to be_nil
19 end
20 end
21
22 describe ".parse" do
23 it "returns ObjectifiedHash" do
24 body = JSON.unparse(a: 1, b: 2)
25 expect(Gitlab::Request.parse(body)).to be_an Gitlab::ObjectifiedHash
26 expect(Gitlab::Request.parse("true")).to be true
27 expect(Gitlab::Request.parse("false")).to be false
28
29 expect { Gitlab::Request.parse("string") }.to raise_error(Gitlab::Error::Parsing)
30 end
31 end
32
33 describe "#request_defaults" do
34 context "when endpoint is not set" do
35 it "raises Error::MissingCredentials" do
36 @request.endpoint = nil
37 expect do
38 @request.request_defaults
39 end.to raise_error(Gitlab::Error::MissingCredentials, 'Please set an endpoint to API')
40 end
41 end
42
43 context "when endpoint is set" do
44 before(:each) do
45 @request.endpoint = 'http://rabbit-hole.example.com'
46 end
47
48 it "sets default_params" do
49 @request.request_defaults('sudoer')
50 expect(Gitlab::Request.default_params).to eq(sudo: 'sudoer')
51 end
52 end
53 end
54
55 describe "#authorization_header" do
56 it "raises MissingCredentials when auth_token and private_token are not set" do
57 expect do
58 @request.send(:authorization_header, {})
59 end.to raise_error(Gitlab::Error::MissingCredentials)
60 end
61
62 it "sets the correct header when given a private_token" do
63 @request.private_token = 'ys9BtunN3rDKbaJCYXaN'
64 expect(@request.send(:authorization_header, {})).to eq("PRIVATE-TOKEN" => 'ys9BtunN3rDKbaJCYXaN')
65 end
66
67 it "sets the correct header when setting an auth_token via the private_token config option" do
68 @request.private_token = '3225e2804d31fea13fc41fc83bffef00cfaedc463118646b154acc6f94747603'
69 expect(@request.send(:authorization_header, {})).to eq("Authorization" => "Bearer 3225e2804d31fea13fc41fc83bffef00cfaedc463118646b154acc6f94747603")
70 end
71 end
72 end
0 require 'spec_helper'
1 require 'tempfile'
2
3 describe Gitlab::Shell::History do
4 context 'saving to a file' do
5 before do
6 @file = Tempfile.new('.gitlab_shell_history')
7 @history = Gitlab::Shell::History.new(file_path: @file.path)
8 end
9
10 after { @file.close(true) }
11
12 it 'saves the lines' do
13 @history << 'party on, dudes'
14 @history << 'be excellent to each other'
15 @history.save
16 expect(File.read @file.path).
17 to eq("party on, dudes\nbe excellent to each other\n")
18 end
19
20 it 'has the lines' do
21 @history << 'party on, dudes'
22 @history << 'be excellent to each other'
23 expect(@history.lines).
24 to eq(["party on, dudes", "be excellent to each other"])
25 end
26
27 it 'limits the lines to GITLAB_HISTFILESIZE' do
28 ENV['GITLAB_HISTFILESIZE'] = '2'
29 @history << 'bogus'
30 @history << 'party on, dudes'
31 @history << 'be excellent to each other'
32 @history.save
33 expect(@history.lines).
34 to eq(["party on, dudes", "be excellent to each other"])
35 expect(File.read @file.path).
36 to eq("party on, dudes\nbe excellent to each other\n")
37 end
38 end
39
40 context 'loading a file' do
41 before do
42 @file = load_fixture('shell_history')
43 @history = Gitlab::Shell::History.new(file_path: @file.path)
44 end
45
46 it 'has the lines' do
47 @history.load
48 expect(@history.lines).
49 to eq(["party on, dudes", "be excellent to each other"])
50 end
51 end
52 end
0 require 'spec_helper'
1
2 describe Gitlab::Shell do
3 before do
4 Gitlab::Shell.setup
5 end
6
7 describe ".execute" do
8 context "invalid command" do
9 it "raises RuntimeError" do
10 expect { Gitlab::Shell.execute 'foobar', [] }.to raise_error(RuntimeError)
11 end
12 end
13 end
14
15 describe ".history" do
16 before do
17 @history = Gitlab::Shell.history
18 end
19
20 it "returns a Gitlab::Shell::History instance" do
21 expect(@history).to be_a Gitlab::Shell::History
22 end
23 it "responds to :save" do
24 expect(@history).to respond_to :save
25 end
26 it "responds to :load" do
27 expect(@history).to respond_to :load
28 end
29 it "responds to :<<" do
30 expect(@history).to respond_to :<<
31 end
32 end
33
34 describe ".setup" do
35 it "sets the Readline completion_proc" do
36 completion = Readline.completion_proc
37 expect(completion).to be_truthy
38 expect(completion).to be_a Proc
39 end
40 it "sets the Readline completion_append_character" do
41 completion_character = Readline.completion_append_character
42 expect(completion_character).to eq(' ')
43 end
44 end
45
46 describe ".completion" do
47 before do
48 @comp = Gitlab::Shell.completion
49 end
50 it "returns a Proc object" do
51 expect(@comp).to be_a Proc
52 end
53 context "called with an argument" do
54 it "returns an Array of matching commands" do
55 completed_cmds = @comp.call 'group'
56 expect(completed_cmds).to be_a Array
57 expect(completed_cmds.sort).to eq(%w(group group_access_requests group_member group_members group_milestone group_milestone_issues group_milestone_merge_requests group_milestones group_projects group_search group_subgroups group_variable group_variables groups))
58 end
59 end
60 end
61
62 describe ".parse_input" do
63 context "with arguments" do
64 it "sets command & arguments" do
65 Gitlab::Shell.parse_input('create_branch 1 "api" "master"')
66 expect(Gitlab::Shell.command).to eq('create_branch')
67 expect(Gitlab::Shell.arguments).to eq(%w(1 api master))
68 end
69 end
70
71 context "without arguments" do
72 it 'sets command & empty arguments' do
73 Gitlab::Shell.parse_input('exit')
74 expect(Gitlab::Shell.command).to eq('exit')
75 expect(Gitlab::Shell.arguments).to be_empty
76 end
77 end
78 end
79 end
0 require 'spec_helper'
1
2 describe Gitlab do
3 after { Gitlab.reset }
4
5 describe ".client" do
6 it "is a Gitlab::Client" do
7 expect(Gitlab.client).to be_a Gitlab::Client
8 end
9
10 it "does not override each other" do
11 client1 = Gitlab.client(endpoint: 'https://api1.example.com', private_token: '001')
12 client2 = Gitlab.client(endpoint: 'https://api2.example.com', private_token: '002')
13 expect(client1.endpoint).to eq('https://api1.example.com')
14 expect(client2.endpoint).to eq('https://api2.example.com')
15 expect(client1.private_token).to eq('001')
16 expect(client2.private_token).to eq('002')
17 end
18
19 it "sets private_token to the auth_token when provided" do
20 client = Gitlab.client(endpoint: 'https://api2.example.com', auth_token: '3225e2804d31fea13fc41fc83bffef00cfaedc463118646b154acc6f94747603')
21 expect(client.private_token).to eq('3225e2804d31fea13fc41fc83bffef00cfaedc463118646b154acc6f94747603')
22 end
23 end
24
25 describe ".actions" do
26 it "returns an array of client methods" do
27 actions = Gitlab.actions
28 expect(actions).to be_an Array
29 expect(actions.first).to be_a Symbol
30 expect(actions.sort.first).to eq(:accept_merge_request)
31 end
32 end
33
34 describe ".endpoint=" do
35 it "sets endpoint" do
36 Gitlab.endpoint = 'https://api.example.com'
37 expect(Gitlab.endpoint).to eq('https://api.example.com')
38 end
39 end
40
41 describe ".private_token=" do
42 it "sets private_token" do
43 Gitlab.private_token = 'secret'
44 expect(Gitlab.private_token).to eq('secret')
45 end
46 end
47
48 describe ".auth_token=" do
49 it "sets auth_token", focus: true do
50 Gitlab.auth_token = 'auth_secret'
51 expect(Gitlab.private_token).to eq('auth_secret')
52 end
53 end
54
55 describe ".sudo=" do
56 it "sets sudo" do
57 Gitlab.sudo = 'user'
58 expect(Gitlab.sudo).to eq('user')
59 end
60 end
61
62 describe ".user_agent" do
63 it "returns default user_agent" do
64 expect(Gitlab.user_agent).to eq(Gitlab::Configuration::DEFAULT_USER_AGENT)
65 end
66 end
67
68 describe ".user_agent=" do
69 it "sets user_agent" do
70 Gitlab.user_agent = 'Custom User Agent'
71 expect(Gitlab.user_agent).to eq('Custom User Agent')
72 end
73 end
74
75 describe ".configure" do
76 Gitlab::Configuration::VALID_OPTIONS_KEYS.each do |key|
77 it "sets #{key}" do
78 Gitlab.configure do |config|
79 config.send("#{key}=", key)
80 expect(Gitlab.send(key)).to eq(key)
81 end
82 end
83 end
84 end
85
86 describe ".http_proxy" do
87 it "delegates the method to Gitlab::Request" do
88 Gitlab.endpoint = 'https://api.example.com'
89 request = class_spy(Gitlab::Request).as_stubbed_const
90
91 Gitlab.http_proxy('proxy.example.net', 1987, 'user', 'pass')
92 expect(request).to have_received(:http_proxy).with('proxy.example.net', 1987, 'user', 'pass')
93 end
94 end
95 end
0 require 'rspec'
1 require 'webmock/rspec'
2
3 require File.expand_path('../../lib/gitlab', __FILE__)
4 require File.expand_path('../../lib/gitlab/cli', __FILE__)
5
6 def capture_output
7 out = StringIO.new
8 $stdout = out
9 $stderr = out
10 yield
11 $stdout = STDOUT
12 $stderr = STDERR
13 out.string
14 end
15
16 def load_fixture(name)
17 File.new(File.dirname(__FILE__) + "/fixtures/#{name}.json")
18 end
19
20 RSpec.configure do |config|
21 config.before(:all) do
22 Gitlab.endpoint = 'https://api.example.com'
23 Gitlab.private_token = 'secret'
24 end
25 end
26
27 %i(get post put delete).each do |method|
28 define_method "stub_#{method}" do |path, fixture, status_code=200|
29 stub_request(method, "#{Gitlab.endpoint}#{path}")
30 .with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
31 .to_return(body: load_fixture(fixture), status: status_code)
32 end
33
34 define_method "a_#{method}" do |path|
35 a_request(method, "#{Gitlab.endpoint}#{path}")
36 .with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token })
37 end
38 end