percy-client 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -30
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +3 -1
  6. data/Guardfile +14 -0
  7. data/LICENSE +2 -2
  8. data/README.md +34 -2
  9. data/Rakefile +1 -1
  10. data/lib/percy.rb +37 -0
  11. data/lib/percy/client.rb +47 -0
  12. data/lib/percy/client/builds.rb +32 -0
  13. data/lib/percy/client/connection.rb +50 -0
  14. data/lib/percy/client/local_git.rb +50 -0
  15. data/lib/percy/client/resources.rb +54 -0
  16. data/lib/percy/client/snapshots.rb +22 -0
  17. data/lib/percy/client/version.rb +5 -0
  18. data/percy-client.gemspec +29 -0
  19. data/spec/cassettes/Percy_Client_Builds/_create_build/creates_a_build.yml +64 -0
  20. data/spec/cassettes/Percy_Client_Builds/_finalize_build/finalizes_a_build.yml +121 -0
  21. data/spec/cassettes/Percy_Client_Resources/_upload_resource/returns_true_with_success.yml +237 -0
  22. data/spec/cassettes/Percy_Client_Snapshots/_create_snapshot/creates_a_build.yml +121 -0
  23. data/spec/cassettes/Percy_Client_Snapshots/_create_snapshot/fails_if_no_resources_are_given.yml +122 -0
  24. data/spec/lib/percy/client/builds_spec.rb +19 -0
  25. data/spec/lib/percy/client/connection_spec.rb +16 -0
  26. data/spec/lib/percy/client/local_git_spec.rb +21 -0
  27. data/spec/lib/percy/client/resources_spec.rb +40 -0
  28. data/spec/lib/percy/client/snapshots_spec.rb +26 -0
  29. data/spec/lib/percy/client_spec.rb +17 -0
  30. data/spec/spec_helper.rb +34 -0
  31. data/spec/support/test_helpers.rb +7 -0
  32. data/spec/support/vcr_setup.rb +27 -0
  33. metadata +116 -9
  34. data/lib/perceptual.rb +0 -5
  35. data/lib/perceptual/version.rb +0 -3
  36. data/perceptual.gemspec +0 -23
@@ -0,0 +1,5 @@
1
+ module Percy
2
+ class Client
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'percy/client/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'percy-client'
8
+ spec.version = Percy::Client::VERSION
9
+ spec.authors = ['Perceptual Inc.']
10
+ spec.email = ['team@percy.io']
11
+ spec.summary = %q{Percy::Client}
12
+ spec.description = %q{}
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'faraday'
22
+ spec.add_dependency 'httpclient'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.7'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.2'
27
+ spec.add_development_dependency 'vcr'
28
+ spec.add_development_dependency 'webmock'
29
+ end
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"data":{"type":"builds","attributes":{"commit-sha":"85e1b2fc5e80c462bb281d4a9b72b3d86e9f5e8f","commit-branch":"master","commit-committed-at":"2015-05-16
9
+ 19:39:41 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Checkpoint
10
+ some initial resources and snapshots work.","pull-request-number":null}}}'
11
+ headers:
12
+ User-Agent:
13
+ - Faraday v0.9.1
14
+ Accept:
15
+ - "*/*"
16
+ Date:
17
+ - Sun, 17 May 2015 04:14:20 GMT
18
+ Content-Type:
19
+ - application/vnd.api+json
20
+ Authorization:
21
+ - Token token="<FILTERED_PERCY_TOKEN>"
22
+ response:
23
+ status:
24
+ code: 201
25
+ message: 'Created '
26
+ headers:
27
+ X-Frame-Options:
28
+ - SAMEORIGIN
29
+ X-Xss-Protection:
30
+ - 1; mode=block
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Allow-Methods:
36
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
37
+ Access-Control-Allow-Headers:
38
+ - Authorization, Content-Type
39
+ Cache-Control:
40
+ - no-cache, no-store, max-age=0, must-revalidate
41
+ Expires:
42
+ - Thu, 01 Jan 1970 00:00:00 GMT
43
+ Content-Type:
44
+ - application/json; charset=utf-8
45
+ X-Request-Id:
46
+ - 445be3a9-2506-4087-9794-b56f5c164f5b
47
+ X-Runtime:
48
+ - '0.018639'
49
+ Server:
50
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
51
+ Date:
52
+ - Sun, 17 May 2015 04:14:20 GMT
53
+ Content-Length:
54
+ - '2419'
55
+ Connection:
56
+ - Keep-Alive
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"data":{"id":"14","type":"builds","attributes":{"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-05-17T04:14:20.322Z","updated-at":"2015-05-17T04:14:20.322Z"},"links":{"self":"/api/v1/builds/14","commit":{"self":"/api/v1/builds/14/links/commit","related":"/api/v1/builds/14/commit","linkage":{"type":"commits","id":"1"}},"repo":{"self":"/api/v1/builds/14/links/repo","related":"/api/v1/builds/14/repo"},"base-build":{"self":"/api/v1/builds/14/links/base-build","related":"/api/v1/builds/14/base-build","linkage":{"type":"builds","id":"13"}},"approved-by":{"self":"/api/v1/builds/14/links/approved-by","related":"/api/v1/builds/14/approved-by"},"snapshots":{"self":"/api/v1/builds/14/links/snapshots","related":"/api/v1/builds/14/snapshots"},"comparisons":{"self":"/api/v1/builds/14/links/comparisons","related":"/api/v1/builds/14/comparisons"}},"meta":{"finalize-link":"/api/v1/builds/14/finalize","approve-link":"/api/v1/builds/14/approve"}},"included":[{"id":"1","type":"commits","attributes":{"sha":"85e1b2fc5e80c462bb281d4a9b72b3d86e9f5e8f","branch":"master","message":"Checkpoint
60
+ some initial resources and snapshots work.","committed-at":"2015-05-16 19:39:41
61
+ -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-05-17T04:02:54.000Z","updated-at":"2015-05-17T04:02:54.000Z"},"links":{"self":"/api/v1/commits/1"}},{"id":"13","type":"builds","attributes":{"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-05-17T04:14:20.000Z","updated-at":"2015-05-17T04:14:20.000Z"},"links":{"self":"/api/v1/builds/13","commit":{"self":"/api/v1/builds/13/links/commit","related":"/api/v1/builds/13/commit","linkage":{"type":"commits","id":"1"}},"repo":{"self":"/api/v1/builds/13/links/repo","related":"/api/v1/builds/13/repo"},"base-build":{"self":"/api/v1/builds/13/links/base-build","related":"/api/v1/builds/13/base-build"},"approved-by":{"self":"/api/v1/builds/13/links/approved-by","related":"/api/v1/builds/13/approved-by"},"snapshots":{"self":"/api/v1/builds/13/links/snapshots","related":"/api/v1/builds/13/snapshots"},"comparisons":{"self":"/api/v1/builds/13/links/comparisons","related":"/api/v1/builds/13/comparisons"}},"meta":{"finalize-link":"/api/v1/builds/13/finalize","approve-link":"/api/v1/builds/13/approve"}}]}'
62
+ http_version:
63
+ recorded_at: Sun, 17 May 2015 04:14:20 GMT
64
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,121 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"data":{"type":"builds","attributes":{"commit-sha":"85e1b2fc5e80c462bb281d4a9b72b3d86e9f5e8f","commit-branch":"master","commit-committed-at":"2015-05-16
9
+ 19:39:41 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Checkpoint
10
+ some initial resources and snapshots work.","pull-request-number":null}}}'
11
+ headers:
12
+ User-Agent:
13
+ - Faraday v0.9.1
14
+ Accept:
15
+ - "*/*"
16
+ Date:
17
+ - Sun, 17 May 2015 04:14:20 GMT
18
+ Content-Type:
19
+ - application/vnd.api+json
20
+ Authorization:
21
+ - Token token="<FILTERED_PERCY_TOKEN>"
22
+ response:
23
+ status:
24
+ code: 201
25
+ message: 'Created '
26
+ headers:
27
+ X-Frame-Options:
28
+ - SAMEORIGIN
29
+ X-Xss-Protection:
30
+ - 1; mode=block
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Allow-Methods:
36
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
37
+ Access-Control-Allow-Headers:
38
+ - Authorization, Content-Type
39
+ Cache-Control:
40
+ - no-cache, no-store, max-age=0, must-revalidate
41
+ Expires:
42
+ - Thu, 01 Jan 1970 00:00:00 GMT
43
+ Content-Type:
44
+ - application/json; charset=utf-8
45
+ X-Request-Id:
46
+ - 40572082-2a68-4b7c-9685-640511064ef9
47
+ X-Runtime:
48
+ - '0.022852'
49
+ Server:
50
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
51
+ Date:
52
+ - Sun, 17 May 2015 04:14:20 GMT
53
+ Content-Length:
54
+ - '2402'
55
+ Connection:
56
+ - Keep-Alive
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"data":{"id":"13","type":"builds","attributes":{"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-05-17T04:14:20.214Z","updated-at":"2015-05-17T04:14:20.214Z"},"links":{"self":"/api/v1/builds/13","commit":{"self":"/api/v1/builds/13/links/commit","related":"/api/v1/builds/13/commit","linkage":{"type":"commits","id":"1"}},"repo":{"self":"/api/v1/builds/13/links/repo","related":"/api/v1/builds/13/repo"},"base-build":{"self":"/api/v1/builds/13/links/base-build","related":"/api/v1/builds/13/base-build","linkage":{"type":"builds","id":"8"}},"approved-by":{"self":"/api/v1/builds/13/links/approved-by","related":"/api/v1/builds/13/approved-by"},"snapshots":{"self":"/api/v1/builds/13/links/snapshots","related":"/api/v1/builds/13/snapshots"},"comparisons":{"self":"/api/v1/builds/13/links/comparisons","related":"/api/v1/builds/13/comparisons"}},"meta":{"finalize-link":"/api/v1/builds/13/finalize","approve-link":"/api/v1/builds/13/approve"}},"included":[{"id":"1","type":"commits","attributes":{"sha":"85e1b2fc5e80c462bb281d4a9b72b3d86e9f5e8f","branch":"master","message":"Checkpoint
60
+ some initial resources and snapshots work.","committed-at":"2015-05-16 19:39:41
61
+ -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-05-17T04:02:54.000Z","updated-at":"2015-05-17T04:02:54.000Z"},"links":{"self":"/api/v1/commits/1"}},{"id":"8","type":"builds","attributes":{"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-05-17T04:12:48.000Z","updated-at":"2015-05-17T04:12:48.000Z"},"links":{"self":"/api/v1/builds/8","commit":{"self":"/api/v1/builds/8/links/commit","related":"/api/v1/builds/8/commit","linkage":{"type":"commits","id":"1"}},"repo":{"self":"/api/v1/builds/8/links/repo","related":"/api/v1/builds/8/repo"},"base-build":{"self":"/api/v1/builds/8/links/base-build","related":"/api/v1/builds/8/base-build"},"approved-by":{"self":"/api/v1/builds/8/links/approved-by","related":"/api/v1/builds/8/approved-by"},"snapshots":{"self":"/api/v1/builds/8/links/snapshots","related":"/api/v1/builds/8/snapshots"},"comparisons":{"self":"/api/v1/builds/8/links/comparisons","related":"/api/v1/builds/8/comparisons"}},"meta":{"finalize-link":"/api/v1/builds/8/finalize","approve-link":"/api/v1/builds/8/approve"}}]}'
62
+ http_version:
63
+ recorded_at: Sun, 17 May 2015 04:14:20 GMT
64
+ - request:
65
+ method: post
66
+ uri: http://localhost:3000/api/v1/builds/13/finalize
67
+ body:
68
+ encoding: UTF-8
69
+ string: "{}"
70
+ headers:
71
+ User-Agent:
72
+ - Faraday v0.9.1
73
+ Accept:
74
+ - "*/*"
75
+ Date:
76
+ - Sun, 17 May 2015 04:14:20 GMT
77
+ Content-Type:
78
+ - application/vnd.api+json
79
+ Authorization:
80
+ - Token token="<FILTERED_PERCY_TOKEN>"
81
+ response:
82
+ status:
83
+ code: 200
84
+ message: 'OK '
85
+ headers:
86
+ X-Frame-Options:
87
+ - SAMEORIGIN
88
+ X-Xss-Protection:
89
+ - 1; mode=block
90
+ X-Content-Type-Options:
91
+ - nosniff
92
+ Access-Control-Allow-Origin:
93
+ - "*"
94
+ Access-Control-Allow-Methods:
95
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
96
+ Access-Control-Allow-Headers:
97
+ - Authorization, Content-Type
98
+ Cache-Control:
99
+ - no-cache, no-store, max-age=0, must-revalidate
100
+ Expires:
101
+ - Thu, 01 Jan 1970 00:00:00 GMT
102
+ Content-Type:
103
+ - application/json; charset=utf-8
104
+ X-Request-Id:
105
+ - 72260d7c-effc-4a03-aad2-93ca69d03220
106
+ X-Runtime:
107
+ - '0.012948'
108
+ Server:
109
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
110
+ Date:
111
+ - Sun, 17 May 2015 04:14:20 GMT
112
+ Content-Length:
113
+ - '16'
114
+ Connection:
115
+ - Keep-Alive
116
+ body:
117
+ encoding: UTF-8
118
+ string: '{"success":true}'
119
+ http_version:
120
+ recorded_at: Sun, 17 May 2015 04:14:20 GMT
121
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,237 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/api/v1/repos/fotinakis/percy-examples/builds/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"data":{"type":"builds","attributes":{"commit-sha":"85e1b2fc5e80c462bb281d4a9b72b3d86e9f5e8f","commit-branch":"master","commit-committed-at":"2015-05-16
9
+ 19:39:41 -0700","commit-author-name":"<COMMIT_AUTHOR_NAME>","commit-author-email":"<COMMIT_AUTHOR_EMAIL>","commit-committer-name":"<COMMIT_AUTHOR_NAME>","commit-committer-email":"<COMMIT_AUTHOR_EMAIL>","commit-message":"Checkpoint
10
+ some initial resources and snapshots work.","pull-request-number":null}}}'
11
+ headers:
12
+ User-Agent:
13
+ - Faraday v0.9.1
14
+ Accept:
15
+ - "*/*"
16
+ Date:
17
+ - Sun, 17 May 2015 04:14:18 GMT
18
+ Content-Type:
19
+ - application/vnd.api+json
20
+ Authorization:
21
+ - Token token="<FILTERED_PERCY_TOKEN>"
22
+ response:
23
+ status:
24
+ code: 201
25
+ message: 'Created '
26
+ headers:
27
+ X-Frame-Options:
28
+ - SAMEORIGIN
29
+ X-Xss-Protection:
30
+ - 1; mode=block
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Allow-Methods:
36
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
37
+ Access-Control-Allow-Headers:
38
+ - Authorization, Content-Type
39
+ Cache-Control:
40
+ - no-cache, no-store, max-age=0, must-revalidate
41
+ Expires:
42
+ - Thu, 01 Jan 1970 00:00:00 GMT
43
+ Content-Type:
44
+ - application/json; charset=utf-8
45
+ X-Request-Id:
46
+ - 4d7e129a-5fe9-406c-9356-68fb11cdfc35
47
+ X-Runtime:
48
+ - '0.020852'
49
+ Server:
50
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
51
+ Date:
52
+ - Sun, 17 May 2015 04:14:18 GMT
53
+ Content-Length:
54
+ - '2402'
55
+ Connection:
56
+ - Keep-Alive
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"data":{"id":"10","type":"builds","attributes":{"state":"pending","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-05-17T04:14:18.798Z","updated-at":"2015-05-17T04:14:18.798Z"},"links":{"self":"/api/v1/builds/10","commit":{"self":"/api/v1/builds/10/links/commit","related":"/api/v1/builds/10/commit","linkage":{"type":"commits","id":"1"}},"repo":{"self":"/api/v1/builds/10/links/repo","related":"/api/v1/builds/10/repo"},"base-build":{"self":"/api/v1/builds/10/links/base-build","related":"/api/v1/builds/10/base-build","linkage":{"type":"builds","id":"8"}},"approved-by":{"self":"/api/v1/builds/10/links/approved-by","related":"/api/v1/builds/10/approved-by"},"snapshots":{"self":"/api/v1/builds/10/links/snapshots","related":"/api/v1/builds/10/snapshots"},"comparisons":{"self":"/api/v1/builds/10/links/comparisons","related":"/api/v1/builds/10/comparisons"}},"meta":{"finalize-link":"/api/v1/builds/10/finalize","approve-link":"/api/v1/builds/10/approve"}},"included":[{"id":"1","type":"commits","attributes":{"sha":"85e1b2fc5e80c462bb281d4a9b72b3d86e9f5e8f","branch":"master","message":"Checkpoint
60
+ some initial resources and snapshots work.","committed-at":"2015-05-16 19:39:41
61
+ -0700","author-name":"<COMMIT_AUTHOR_NAME>","committer-name":"<COMMIT_AUTHOR_NAME>","created-at":"2015-05-17T04:02:54.000Z","updated-at":"2015-05-17T04:02:54.000Z"},"links":{"self":"/api/v1/commits/1"}},{"id":"8","type":"builds","attributes":{"state":"finished","is-pull-request":false,"pull-request-number":0,"pull-request-title":null,"approved-at":null,"created-at":"2015-05-17T04:12:48.000Z","updated-at":"2015-05-17T04:12:48.000Z"},"links":{"self":"/api/v1/builds/8","commit":{"self":"/api/v1/builds/8/links/commit","related":"/api/v1/builds/8/commit","linkage":{"type":"commits","id":"1"}},"repo":{"self":"/api/v1/builds/8/links/repo","related":"/api/v1/builds/8/repo"},"base-build":{"self":"/api/v1/builds/8/links/base-build","related":"/api/v1/builds/8/base-build"},"approved-by":{"self":"/api/v1/builds/8/links/approved-by","related":"/api/v1/builds/8/approved-by"},"snapshots":{"self":"/api/v1/builds/8/links/snapshots","related":"/api/v1/builds/8/snapshots"},"comparisons":{"self":"/api/v1/builds/8/links/comparisons","related":"/api/v1/builds/8/comparisons"}},"meta":{"finalize-link":"/api/v1/builds/8/finalize","approve-link":"/api/v1/builds/8/approve"}}]}'
62
+ http_version:
63
+ recorded_at: Sun, 17 May 2015 04:14:18 GMT
64
+ - request:
65
+ method: post
66
+ uri: http://localhost:3000/api/v1/builds/10/snapshots/
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"data":{"type":"snapshots","attributes":{"name":"homepage"},"links":{"resources":[{"type":"resources","id":"7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9","resource-url":"/foo/test.html","mimetype":null,"is-root":true}]}}}'
70
+ headers:
71
+ User-Agent:
72
+ - Faraday v0.9.1
73
+ Accept:
74
+ - "*/*"
75
+ Date:
76
+ - Sun, 17 May 2015 04:14:18 GMT
77
+ Content-Type:
78
+ - application/vnd.api+json
79
+ Authorization:
80
+ - Token token="<FILTERED_PERCY_TOKEN>"
81
+ response:
82
+ status:
83
+ code: 201
84
+ message: 'Created '
85
+ headers:
86
+ X-Frame-Options:
87
+ - SAMEORIGIN
88
+ X-Xss-Protection:
89
+ - 1; mode=block
90
+ X-Content-Type-Options:
91
+ - nosniff
92
+ Access-Control-Allow-Origin:
93
+ - "*"
94
+ Access-Control-Allow-Methods:
95
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
96
+ Access-Control-Allow-Headers:
97
+ - Authorization, Content-Type
98
+ Cache-Control:
99
+ - no-cache, no-store, max-age=0, must-revalidate
100
+ Expires:
101
+ - Thu, 01 Jan 1970 00:00:00 GMT
102
+ Content-Type:
103
+ - application/json; charset=utf-8
104
+ X-Request-Id:
105
+ - c772c50b-f43f-4fcb-9f78-a554dbe70ad8
106
+ X-Runtime:
107
+ - '0.040375'
108
+ Server:
109
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
110
+ Date:
111
+ - Sun, 17 May 2015 04:14:18 GMT
112
+ Content-Length:
113
+ - '1454'
114
+ Connection:
115
+ - Keep-Alive
116
+ body:
117
+ encoding: UTF-8
118
+ string: '{"data":{"id":"6","type":"snapshots","attributes":{"name":"homepage","created-at":"2015-05-17T04:14:18.822Z","updated-at":"2015-05-17T04:14:18.822Z"},"links":{"self":"/api/v1/snapshots/6","build":{"self":"/api/v1/snapshots/6/links/build","related":"/api/v1/snapshots/6/build"},"screenshots":{"self":"/api/v1/snapshots/6/links/screenshots","related":"/api/v1/snapshots/6/screenshots"},"resources":{"self":"/api/v1/snapshots/6/links/resources","related":"/api/v1/snapshots/6/resources","linkage":[{"type":"resources","id":"7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9"}]},"missing-resources":{"self":"/api/v1/snapshots/6/links/missing-resources","related":"/api/v1/snapshots/6/missing-resources","linkage":[{"type":"resources","id":"7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9"}]}}},"included":[{"id":"7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9","type":"resources","attributes":{"is-root":true,"resource-url":"http://localhost/foo/test.html","mimetype":"text/html","uploaded-at":null,"created-at":"2015-05-17T04:14:18.000Z","updated-at":"2015-05-17T04:14:18.000Z"},"links":{"self":"/api/v1/resources/7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9","snapshot":{"self":"/api/v1/resources/7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9/links/snapshot","related":"/api/v1/resources/7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9/snapshot"}}}]}'
119
+ http_version:
120
+ recorded_at: Sun, 17 May 2015 04:14:18 GMT
121
+ - request:
122
+ method: post
123
+ uri: http://localhost:3000/api/v1/builds/10/resources/
124
+ body:
125
+ encoding: UTF-8
126
+ string: '{"data":{"type":"resources","attributes":{"id":"7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9","base64-content":"aGVsbG8gd29ybGQh"}}}'
127
+ headers:
128
+ User-Agent:
129
+ - Faraday v0.9.1
130
+ Accept:
131
+ - "*/*"
132
+ Date:
133
+ - Sun, 17 May 2015 04:14:18 GMT
134
+ Content-Type:
135
+ - application/vnd.api+json
136
+ Authorization:
137
+ - Token token="<FILTERED_PERCY_TOKEN>"
138
+ response:
139
+ status:
140
+ code: 201
141
+ message: 'Created '
142
+ headers:
143
+ X-Frame-Options:
144
+ - SAMEORIGIN
145
+ X-Xss-Protection:
146
+ - 1; mode=block
147
+ X-Content-Type-Options:
148
+ - nosniff
149
+ Access-Control-Allow-Origin:
150
+ - "*"
151
+ Access-Control-Allow-Methods:
152
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
153
+ Access-Control-Allow-Headers:
154
+ - Authorization, Content-Type
155
+ Cache-Control:
156
+ - no-cache, no-store, max-age=0, must-revalidate
157
+ Expires:
158
+ - Thu, 01 Jan 1970 00:00:00 GMT
159
+ Content-Type:
160
+ - application/json; charset=utf-8
161
+ X-Request-Id:
162
+ - 71fa2e8d-79c6-4d4c-a840-649a9eb89b5b
163
+ X-Runtime:
164
+ - '0.973812'
165
+ Server:
166
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
167
+ Date:
168
+ - Sun, 17 May 2015 04:14:19 GMT
169
+ Content-Length:
170
+ - '16'
171
+ Connection:
172
+ - Keep-Alive
173
+ body:
174
+ encoding: UTF-8
175
+ string: '{"success":true}'
176
+ http_version:
177
+ recorded_at: Sun, 17 May 2015 04:14:19 GMT
178
+ - request:
179
+ method: post
180
+ uri: http://localhost:3000/api/v1/builds/10/resources/
181
+ body:
182
+ encoding: UTF-8
183
+ string: '{"data":{"type":"resources","attributes":{"id":"7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9","base64-content":"aGVsbG8gd29ybGQh"}}}'
184
+ headers:
185
+ User-Agent:
186
+ - Faraday v0.9.1
187
+ Accept:
188
+ - "*/*"
189
+ Date:
190
+ - Sun, 17 May 2015 04:14:19 GMT
191
+ Content-Type:
192
+ - application/vnd.api+json
193
+ Authorization:
194
+ - Token token="<FILTERED_PERCY_TOKEN>"
195
+ response:
196
+ status:
197
+ code: 409
198
+ message: 'Conflict '
199
+ headers:
200
+ X-Frame-Options:
201
+ - SAMEORIGIN
202
+ X-Xss-Protection:
203
+ - 1; mode=block
204
+ X-Content-Type-Options:
205
+ - nosniff
206
+ Access-Control-Allow-Origin:
207
+ - "*"
208
+ Access-Control-Allow-Methods:
209
+ - GET, POST, PUT, PATCH, DELETE, OPTIONS
210
+ Access-Control-Allow-Headers:
211
+ - Authorization, Content-Type
212
+ Cache-Control:
213
+ - no-cache, no-store, max-age=0, must-revalidate
214
+ Expires:
215
+ - Thu, 01 Jan 1970 00:00:00 GMT
216
+ Content-Type:
217
+ - application/json; charset=utf-8
218
+ X-Request-Id:
219
+ - fa3edaef-c7ce-4906-910a-ac1e32b436d7
220
+ X-Runtime:
221
+ - '0.007507'
222
+ Server:
223
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
224
+ Date:
225
+ - Sun, 17 May 2015 04:14:19 GMT
226
+ Content-Length:
227
+ - '165'
228
+ Connection:
229
+ - Keep-Alive
230
+ body:
231
+ encoding: UTF-8
232
+ string: '{"errors":[{"status":"conflict","detail":"Upload failed, resource with
233
+ SHA-256 ''7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9''
234
+ already exists."}]}'
235
+ http_version:
236
+ recorded_at: Sun, 17 May 2015 04:14:19 GMT
237
+ recorded_with: VCR 2.9.3