github_api 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. data/README.md +1 -1
  2. data/features/cassettes/ratelimit/get.yml +64 -0
  3. data/features/cassettes/ratelimit/get_remaining.yml +64 -0
  4. data/features/cassettes/repos/contents/create.yml +60 -0
  5. data/features/cassettes/repos/contents/delete.yml +59 -0
  6. data/features/cassettes/repos/contents/update.yml +62 -0
  7. data/features/issues.feature +3 -3
  8. data/features/pagination.feature +12 -12
  9. data/features/rate_limit.feature +16 -0
  10. data/features/repos/contents.feature +39 -0
  11. data/features/support/settings.rb +5 -1
  12. data/features/support/vcr.rb +1 -0
  13. data/lib/github_api/issues.rb +2 -16
  14. data/lib/github_api/jsonable.rb +1 -0
  15. data/lib/github_api/params_hash.rb +13 -0
  16. data/lib/github_api/rate_limit.rb +8 -4
  17. data/lib/github_api/repos.rb +2 -2
  18. data/lib/github_api/repos/contents.rb +110 -0
  19. data/lib/github_api/response/raise_error.rb +2 -2
  20. data/lib/github_api/version.rb +1 -1
  21. data/spec/fixtures/repos/content_created.json +44 -0
  22. data/spec/fixtures/repos/content_deleted.json +30 -0
  23. data/spec/github/api_spec.rb +2 -0
  24. data/spec/github/issues/list_spec.rb +10 -0
  25. data/spec/github/mime_type_spec.rb +2 -0
  26. data/spec/github/normalizer_spec.rb +2 -0
  27. data/spec/github/parameter_filter_spec.rb +2 -0
  28. data/spec/github/params_hash_spec.rb +5 -0
  29. data/spec/github/repos/contents/create_spec.rb +41 -0
  30. data/spec/github/repos/contents/delete_spec.rb +55 -0
  31. data/spec/github/repos/downloads/delete_spec.rb +2 -3
  32. data/spec/github/request/jsonize_spec.rb +2 -0
  33. data/spec/github/request/oauth2_spec.rb +2 -0
  34. data/spec/github/s3_uploader_spec.rb +2 -0
  35. data/spec/github/utils/url_spec.rb +2 -0
  36. data/spec/github/validations_spec.rb +2 -0
  37. data/spec/integration/multiple_invocations_spec.rb +2 -2
  38. metadata +52 -42
data/README.md CHANGED
@@ -26,7 +26,7 @@ Supports all the API methods(nearly 200). It's build in a modular way, that is,
26
26
  * Supports multithreaded environment.
27
27
  * Custom media types specification through 'media' parameter. [media](#media-types)
28
28
  * Request results caching (Status: TODO)
29
- * Fully tested with test coverage above 90% with over 1,500 specs and 800 features. [testing](#testing)
29
+ * Fully tested with test coverage above 90% with over 1,600 specs and 900 features. [testing](#testing)
30
30
 
31
31
  ## Installation
32
32
 
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/rate_limit?access_token=<TOKEN>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.10.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - GitHub.com
25
+ Date:
26
+ - Fri, 21 Jun 2013 21:31:45 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ X-Ratelimit-Limit:
36
+ - '5000'
37
+ X-Ratelimit-Remaining:
38
+ - '5000'
39
+ X-Github-Media-Type:
40
+ - github.v3; format=json
41
+ X-Content-Type-Options:
42
+ - nosniff
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Access-Control-Expose-Headers:
46
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
47
+ Access-Control-Allow-Origin:
48
+ - ! '*'
49
+ Etag:
50
+ - ! '"5d9e87bc7cbd54a123abd85f8d265f38"'
51
+ Cache-Control:
52
+ - max-age=0, private, must-revalidate
53
+ Vary:
54
+ - Accept-Encoding
55
+ Content-Encoding:
56
+ - gzip
57
+ body:
58
+ encoding: ASCII-8BIT
59
+ string: !binary |-
60
+ H4sIAAAAAAAAA6tWKkosSVWyqlbKyczNLFGyMjUwMNBRKkrNTczMy8xLhwjU
61
+ 1gIAWEFOoigAAAA=
62
+ http_version: !!null
63
+ recorded_at: Fri, 21 Jun 2013 21:31:45 GMT
64
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/rate_limit?access_token=<TOKEN>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.10.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - GitHub.com
25
+ Date:
26
+ - Fri, 21 Jun 2013 21:37:35 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ X-Ratelimit-Limit:
36
+ - '5000'
37
+ X-Ratelimit-Remaining:
38
+ - '5000'
39
+ X-Github-Media-Type:
40
+ - github.v3; format=json
41
+ X-Content-Type-Options:
42
+ - nosniff
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Access-Control-Expose-Headers:
46
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
47
+ Access-Control-Allow-Origin:
48
+ - ! '*'
49
+ Etag:
50
+ - ! '"5d9e87bc7cbd54a123abd85f8d265f38"'
51
+ Cache-Control:
52
+ - max-age=0, private, must-revalidate
53
+ Vary:
54
+ - Accept-Encoding
55
+ Content-Encoding:
56
+ - gzip
57
+ body:
58
+ encoding: ASCII-8BIT
59
+ string: !binary |-
60
+ H4sIAAAAAAAAA6tWKkosSVWyqlbKyczNLFGyMjUwMNBRKkrNTczMy8xLhwjU
61
+ 1gIAWEFOoigAAAA=
62
+ http_version: !!null
63
+ recorded_at: Fri, 21 Jun 2013 21:37:35 GMT
64
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,60 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://<BASIC_AUTH>@api.github.com/repos/<USER>/github_api_test/contents/hello.rb?access_token=<TOKEN>
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"path":"hello.txt","content":"cHV0cyAncnVieSc=","message":"Initial
9
+ commit"}'
10
+ headers:
11
+ Accept:
12
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
13
+ Accept-Charset:
14
+ - utf-8
15
+ User-Agent:
16
+ - Github Ruby Gem 0.10.1
17
+ Content-Type:
18
+ - application/json
19
+ response:
20
+ status:
21
+ code: 201
22
+ message: Created
23
+ headers:
24
+ Server:
25
+ - GitHub.com
26
+ Date:
27
+ - Sat, 22 Jun 2013 18:52:28 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Connection:
31
+ - keep-alive
32
+ Status:
33
+ - 201 Created
34
+ X-Ratelimit-Limit:
35
+ - '5000'
36
+ X-Ratelimit-Remaining:
37
+ - '4996'
38
+ X-Github-Media-Type:
39
+ - github.v3; format=json
40
+ X-Content-Type-Options:
41
+ - nosniff
42
+ Content-Length:
43
+ - '1591'
44
+ Access-Control-Allow-Credentials:
45
+ - 'true'
46
+ Access-Control-Expose-Headers:
47
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
48
+ Access-Control-Allow-Origin:
49
+ - ! '*'
50
+ Etag:
51
+ - ! '"c2799bffff066a8a0426028d643e6ec3"'
52
+ Cache-Control:
53
+ - max-age=0, private, must-revalidate
54
+ body:
55
+ encoding: US-ASCII
56
+ string: ! '{"content":{"name":"hello.rb","path":"hello.rb","sha":"25b0bef9e404bd2e3233de26b7ef8cbd86d0e913","size":11,"url":"https://api.github.com/repos/<USER>/github_api_test/contents/hello.rb?ref=master","html_url":"https://github.com/<USER>/github_api_test/blob/master/hello.rb","git_url":"https://api.github.com/repos/<USER>/github_api_test/git/blobs/25b0bef9e404bd2e3233de26b7ef8cbd86d0e913","type":"file","_links":{"self":"https://api.github.com/repos/<USER>/github_api_test/contents/hello.rb?ref=master","git":"https://api.github.com/repos/<USER>/github_api_test/git/blobs/25b0bef9e404bd2e3233de26b7ef8cbd86d0e913","html":"https://github.com/<USER>/github_api_test/blob/master/hello.rb"}},"commit":{"sha":"17944da9b9b1a143d141507480facd17263cf6d8","url":"https://api.github.com/repos/<USER>/github_api_test/git/commits/17944da9b9b1a143d141507480facd17263cf6d8","html_url":"https://github.com/<USER>/github_api_test/commits/17944da9b9b1a143d141507480facd17263cf6d8","author":{"name":"<USER>","email":"<EMAIL>","date":"2013-06-22T18:52:27Z"},"committer":{"name":"<USER>","email":"<EMAIL>","date":"2013-06-22T18:52:27Z"},"tree":{"sha":"68416c56385741b05dc93ffd00618b32a45b69e2","url":"https://api.github.com/repos/<USER>/github_api_test/git/trees/68416c56385741b05dc93ffd00618b32a45b69e2"},"message":"Initial
57
+ commit","parents":[{"sha":"8b1c1a560db750f0725f7a7778abfceda1c64103","url":"https://api.github.com/repos/<USER>/github_api_test/git/commits/8b1c1a560db750f0725f7a7778abfceda1c64103","html_url":"https://github.com/<USER>/github_api_test/commits/8b1c1a560db750f0725f7a7778abfceda1c64103"}]}}'
58
+ http_version: !!null
59
+ recorded_at: Sat, 22 Jun 2013 18:52:28 GMT
60
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://<BASIC_AUTH>@api.github.com/repos/<USER>/github_api_test/contents/hello.rb?access_token=<TOKEN>&message=Delete%20hello.rb%20file&path=hello.txt&sha=25b0bef9e404bd2e3233de26b7ef8cbd86d0e913
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.10.1
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - GitHub.com
23
+ Date:
24
+ - Sat, 22 Jun 2013 18:51:32 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Connection:
28
+ - keep-alive
29
+ Status:
30
+ - 200 OK
31
+ X-Ratelimit-Limit:
32
+ - '5000'
33
+ X-Ratelimit-Remaining:
34
+ - '4997'
35
+ X-Github-Media-Type:
36
+ - github.v3; format=json
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ Content-Length:
40
+ - '933'
41
+ Access-Control-Allow-Credentials:
42
+ - 'true'
43
+ Access-Control-Expose-Headers:
44
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
45
+ Access-Control-Allow-Origin:
46
+ - ! '*'
47
+ Etag:
48
+ - ! '"ab64a47801386e907c217a850d779f17"'
49
+ Cache-Control:
50
+ - max-age=0, private, must-revalidate
51
+ Vary:
52
+ - Accept-Encoding
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ! '{"content":null,"commit":{"sha":"8b1c1a560db750f0725f7a7778abfceda1c64103","url":"https://api.github.com/repos/<USER>/github_api_test/git/commits/8b1c1a560db750f0725f7a7778abfceda1c64103","html_url":"https://github.com/<USER>/github_api_test/commits/8b1c1a560db750f0725f7a7778abfceda1c64103","author":{"name":"<USER>","email":"<EMAIL>","date":"2013-06-22T18:51:32Z"},"committer":{"name":"<USER>","email":"<EMAIL>","date":"2013-06-22T18:51:32Z"},"tree":{"sha":"f93e3a1a1525fb5b91020da86e44810c87a2d7bc","url":"https://api.github.com/repos/<USER>/github_api_test/git/trees/f93e3a1a1525fb5b91020da86e44810c87a2d7bc"},"message":"Delete
56
+ hello.rb file","parents":[{"sha":"4b3bda29b07b79de87042ab410c3a5794abbed7c","url":"https://api.github.com/repos/<USER>/github_api_test/git/commits/4b3bda29b07b79de87042ab410c3a5794abbed7c","html_url":"https://github.com/<USER>/github_api_test/commits/4b3bda29b07b79de87042ab410c3a5794abbed7c"}]}}'
57
+ http_version: !!null
58
+ recorded_at: Sat, 22 Jun 2013 18:51:32 GMT
59
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://<BASIC_AUTH>@api.github.com/repos/<USER>/github_api_test/contents/hello.rb?access_token=<TOKEN>
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"path":"hello.rb","content":"cHV0cyAnaGVsbG8gcnVieSc=","message":"Update
9
+ commit","sha":"25b0bef9e404bd2e3233de26b7ef8cbd86d0e913"}'
10
+ headers:
11
+ Accept:
12
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
13
+ Accept-Charset:
14
+ - utf-8
15
+ User-Agent:
16
+ - Github Ruby Gem 0.10.1
17
+ Content-Type:
18
+ - application/json
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - GitHub.com
26
+ Date:
27
+ - Sat, 22 Jun 2013 19:02:17 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Connection:
31
+ - keep-alive
32
+ Status:
33
+ - 200 OK
34
+ X-Ratelimit-Limit:
35
+ - '5000'
36
+ X-Ratelimit-Remaining:
37
+ - '4995'
38
+ X-Github-Media-Type:
39
+ - github.v3; format=json
40
+ X-Content-Type-Options:
41
+ - nosniff
42
+ Content-Length:
43
+ - '1590'
44
+ Access-Control-Allow-Credentials:
45
+ - 'true'
46
+ Access-Control-Expose-Headers:
47
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
48
+ Access-Control-Allow-Origin:
49
+ - ! '*'
50
+ Etag:
51
+ - ! '"e50acd6b435b2ea531988ed19aedc1b2"'
52
+ Cache-Control:
53
+ - max-age=0, private, must-revalidate
54
+ Vary:
55
+ - Accept-Encoding
56
+ body:
57
+ encoding: US-ASCII
58
+ string: ! '{"content":{"name":"hello.rb","path":"hello.rb","sha":"9ed559bc7c227577c734a1d71e84646058c28ab7","size":17,"url":"https://api.github.com/repos/<USER>/github_api_test/contents/hello.rb?ref=master","html_url":"https://github.com/<USER>/github_api_test/blob/master/hello.rb","git_url":"https://api.github.com/repos/<USER>/github_api_test/git/blobs/9ed559bc7c227577c734a1d71e84646058c28ab7","type":"file","_links":{"self":"https://api.github.com/repos/<USER>/github_api_test/contents/hello.rb?ref=master","git":"https://api.github.com/repos/<USER>/github_api_test/git/blobs/9ed559bc7c227577c734a1d71e84646058c28ab7","html":"https://github.com/<USER>/github_api_test/blob/master/hello.rb"}},"commit":{"sha":"a204cd99a174edb4ff8b7c561b7356959421f81c","url":"https://api.github.com/repos/<USER>/github_api_test/git/commits/a204cd99a174edb4ff8b7c561b7356959421f81c","html_url":"https://github.com/<USER>/github_api_test/commits/a204cd99a174edb4ff8b7c561b7356959421f81c","author":{"name":"<USER>","email":"<EMAIL>","date":"2013-06-22T19:02:17Z"},"committer":{"name":"<USER>","email":"<EMAIL>","date":"2013-06-22T19:02:17Z"},"tree":{"sha":"1c6d09bb0aaa44e285234d5e6572b54232079a58","url":"https://api.github.com/repos/<USER>/github_api_test/git/trees/1c6d09bb0aaa44e285234d5e6572b54232079a58"},"message":"Update
59
+ commit","parents":[{"sha":"17944da9b9b1a143d141507480facd17263cf6d8","url":"https://api.github.com/repos/<USER>/github_api_test/git/commits/17944da9b9b1a143d141507480facd17263cf6d8","html_url":"https://github.com/<USER>/github_api_test/commits/17944da9b9b1a143d141507480facd17263cf6d8"}]}}'
60
+ http_version: !!null
61
+ recorded_at: Sat, 22 Jun 2013 19:02:17 GMT
62
+ recorded_with: VCR 2.4.0
@@ -15,12 +15,12 @@ Feature: Issues API
15
15
 
16
16
  Scenario: List on repository
17
17
 
18
- Given I want to list_repo resources with the following params:
18
+ Given I want to list resources with the following params:
19
19
  | user | repo |
20
20
  | peter-murach | github |
21
21
  And I pass the following request options:
22
- | state | assignee | sort | direction |
23
- | closed | none | created | asc |
22
+ | state | assignee | sort | direction | user | repo |
23
+ | closed | none | created | asc | peter-murach | github |
24
24
  When I make request within a cassette named "issues/list/repo"
25
25
  Then the response status should be 200
26
26
  And the response type should be JSON
@@ -83,12 +83,12 @@ Feature: Github API pagination
83
83
  Scenario: Navigating resource links with query parameters
84
84
 
85
85
  Given I have "Github::Issues" instance
86
- And I want to list_repo resources with the following params:
86
+ And I want to list resources with the following params:
87
87
  | user | repo |
88
88
  | wycats | thor |
89
89
  And I pass the following request options:
90
- | state | per_page |
91
- | closed | 50 |
90
+ | state | per_page | user | repo |
91
+ | closed | 50 | wycats | thor |
92
92
  When I make request within a cassette named "pagination/issues/list/first"
93
93
  Then the response status should be 200
94
94
  And the response next link should contain:
@@ -100,12 +100,12 @@ Feature: Github API pagination
100
100
 
101
101
  Scenario: Navigate to Next page
102
102
  Given I have "Github::Issues" instance
103
- And I want to list_repo resources with the following params:
103
+ And I want to list resources with the following params:
104
104
  | user | repo |
105
105
  | wycats | thor |
106
106
  And I pass the following request options:
107
- | state | per_page |
108
- | closed | 50 |
107
+ | state | per_page | user | repo |
108
+ | closed | 50 | wycats | thor |
109
109
  When I make request within a cassette named "pagination/issues/list/first"
110
110
  And I request next page within a cassette named "pagination/issues/list/next"
111
111
  Then the response status should be 200
@@ -125,12 +125,12 @@ Feature: Github API pagination
125
125
  Scenario: Navigate to Last page
126
126
 
127
127
  Given I have "Github::Issues" instance
128
- And I want to list_repo resources with the following params:
128
+ And I want to list resources with the following params:
129
129
  | user | repo |
130
130
  | wycats | thor |
131
131
  And I pass the following request options:
132
- | state | per_page |
133
- | closed | 50 |
132
+ | state | per_page | user | repo |
133
+ | closed | 50 | wycats | thor |
134
134
  When I make request within a cassette named "pagination/issues/list/first"
135
135
  And I request last page within a cassette named "pagination/issues/list/last"
136
136
  Then the response status should be 200
@@ -144,12 +144,12 @@ Feature: Github API pagination
144
144
  Scenario: Navigate to Previous page
145
145
 
146
146
  Given I have "Github::Issues" instance
147
- And I want to list_repo resources with the following params:
147
+ And I want to list resources with the following params:
148
148
  | user | repo |
149
149
  | wycats | thor |
150
150
  And I pass the following request options:
151
- | state | per_page | page |
152
- | closed | 50 | 4 |
151
+ | state | per_page | page | user | repo |
152
+ | closed | 50 | 4 | wycats | thor |
153
153
  When I make request within a cassette named "pagination/issues/list/last"
154
154
  And I request prev page within a cassette named "pagination/issues/list/prev"
155
155
  Then the response status should be 200
@@ -0,0 +1,16 @@
1
+ Feature: Ratelimit API
2
+
3
+ Background:
4
+ Given I have "Github::API" instance
5
+
6
+ Scenario: Get ratelimit
7
+
8
+ Given I want to ratelimit resource
9
+ When I make request within a cassette named "ratelimit/get"
10
+ Then the response should be 5000
11
+
12
+ Scenario: Get ratelimit remaining
13
+
14
+ Given I want to ratelimit_remaining resource
15
+ When I make request within a cassette named "ratelimit/get_remaining"
16
+ Then the response should be 5000
@@ -23,6 +23,45 @@ Feature: Contents API
23
23
  And the response type should be JSON
24
24
  And the response should not be empty
25
25
 
26
+ Scenario: Create a file
27
+
28
+ Given I want create resource with the following params:
29
+ | user | repo | path |
30
+ | murek | github_api_test | hello.rb |
31
+ And I pass the following request options:
32
+ | path | content | message |
33
+ | hello.rb | puts 'ruby' | Initial commit |
34
+ When I make request within a cassette named "repos/contents/create"
35
+ Then the response status should be 201
36
+ And the response type should be JSON
37
+ And the response should not be empty
38
+
39
+ Scenario: Update a file
40
+
41
+ Given I want create resource with the following params:
42
+ | user | repo | path |
43
+ | murek | github_api_test | hello.rb |
44
+ And I pass the following request options:
45
+ | path | content | message | sha |
46
+ | hello.rb | puts 'hello ruby' | Update commit | 25b0bef9e404bd2e3233de26b7ef8cbd86d0e913 |
47
+ When I make request within a cassette named "repos/contents/update"
48
+ Then the response status should be 200
49
+ And the response type should be JSON
50
+ And the response should not be empty
51
+
52
+ Scenario: Delete a file
53
+
54
+ Given I want delete resource with the following params:
55
+ | user | repo | path |
56
+ | murek | github_api_test | hello.rb |
57
+ And I pass the following request options:
58
+ | path | message | sha |
59
+ | hello.txt | Delete hello.rb file | 25b0bef9e404bd2e3233de26b7ef8cbd86d0e913 |
60
+ When I make request within a cassette named "repos/contents/delete"
61
+ Then the response status should be 200
62
+ And the response type should be JSON
63
+ And the response should not be empty
64
+
26
65
  Scenario: Archive
27
66
 
28
67
  Given I want archive resource with the following params: