locomotivecms_coal 1.6.0.beta1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +2 -3
  4. data/Gemfile +1 -6
  5. data/Gemfile.lock +54 -59
  6. data/MIT-LICENSE +1 -1
  7. data/README.md +20 -5
  8. data/lib/locomotive/coal/client.rb +8 -0
  9. data/lib/locomotive/coal/resources/accounts.rb +33 -0
  10. data/lib/locomotive/coal/resources/concerns/request.rb +19 -1
  11. data/lib/locomotive/coal/version.rb +1 -1
  12. data/lib/locomotive/coal.rb +1 -0
  13. data/locomotivecms_coal.gemspec +5 -6
  14. data/spec/fixtures/coal_cassettes/accounts.yml +214 -0
  15. data/spec/fixtures/coal_cassettes/client.yml +277 -163
  16. data/spec/fixtures/coal_cassettes/content_assets.yml +144 -445
  17. data/spec/fixtures/coal_cassettes/content_entries.yml +963 -1647
  18. data/spec/fixtures/coal_cassettes/content_types.yml +387 -209
  19. data/spec/fixtures/coal_cassettes/current_site.yml +89 -49
  20. data/spec/fixtures/coal_cassettes/memberships.yml +143 -77
  21. data/spec/fixtures/coal_cassettes/my_account.yml +163 -99
  22. data/spec/fixtures/coal_cassettes/pages.yml +177 -99
  23. data/spec/fixtures/coal_cassettes/sections.yml +121 -78
  24. data/spec/fixtures/coal_cassettes/sites.yml +108 -141
  25. data/spec/fixtures/coal_cassettes/snippets.yml +140 -76
  26. data/spec/fixtures/coal_cassettes/theme_assets.yml +142 -254
  27. data/spec/fixtures/coal_cassettes/token.yml +64 -43
  28. data/spec/fixtures/coal_cassettes/translations.yml +140 -76
  29. data/spec/fixtures/coal_cassettes/version.yml +54 -30
  30. data/spec/integration/resources/accounts_spec.rb +38 -0
  31. data/spec/integration/resources/sections_spec.rb +1 -1
  32. data/spec/integration/resources/token_spec.rb +1 -1
  33. metadata +20 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52e508034f1bf2fb7543cac7cdd993d970f50e404711eb931c473e08ba39cbff
4
- data.tar.gz: a6fc26f79e02e09e22cefa711f61ac6031dd95d07ef0684767fbfd50cfa4dc37
3
+ metadata.gz: 770fd2f69517472020c9cde5861eb02a0892c53bc132a7b5bfb6525cc28de723
4
+ data.tar.gz: bc31157ea14c0ee58108056c7ee786369833c39501987244f6253da1a6ada58a
5
5
  SHA512:
6
- metadata.gz: 45ef04a703b534d2cff43327262deb5600ec58f894523100f038eda5ad8ce525b53450551c1efae99d8f0e4cc557fd08d33e8789e90b1fa937d1235fde40c5c5
7
- data.tar.gz: 9103f51b7bd5621e46478bf4009e4a5d34264c754a288170c3c216f8ac59a8c389d05d4285bfcf9cacc1311aa2089c9292fb538f1e289cba2f39328553c08af2
6
+ metadata.gz: 76a98ae150c76b71dbffbdce6d7c57468170ee5a7cac541084b4e960c06ecd1500eeddd124c482bdaaa5536954d5b93d08b6bf558893b1df13443ab9774cb3bf
7
+ data.tar.gz: 78b7292e3113cfb04e60e8d02a582848a55ab9a7cacfad25bf518f6e7a04d00c7b1a4cc6a3913817675802bac8501d4756cb1f5d946c648a3d98b626711ae443
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  coverage/
2
2
  pkg/
3
3
  .DS_Store
4
+ .ruby-version
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.5.0
4
- env:
5
- - CODECLIMATE_REPO_TOKEN=8d9c25de4eff1cd06d3accdc09775397e1a81be67e2a159453ba4e4408acae16
3
+ - 2.6.5
4
+ - 2.7.2
6
5
  addons:
7
6
  code_climate:
8
7
  repo_token: 8d9c25de4eff1cd06d3accdc09775397e1a81be67e2a159453ba4e4408acae16
data/Gemfile CHANGED
@@ -11,15 +11,10 @@ group :test do
11
11
  gem 'rspec', '~> 3.5.0'
12
12
  gem 'json_spec', '~> 1.1.4'
13
13
 
14
- gem 'pry-byebug', '~> 3.4.2'
14
+ gem 'pry-byebug', '~> 3.9.0'
15
15
 
16
16
  gem 'webmock'
17
17
  gem 'vcr'
18
18
 
19
- gem 'codeclimate-test-reporter', '~> 1.0.7', require: false
20
19
  gem 'coveralls', '~> 0.8.19', require: false
21
20
  end
22
-
23
- platform :ruby do
24
- ruby '2.5.0'
25
- end
data/Gemfile.lock CHANGED
@@ -1,70 +1,68 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- locomotivecms_coal (1.6.0.beta1)
5
- activesupport (>= 5.1.5, < 6.0)
6
- faraday (~> 0.15.4)
7
- faraday_middleware (~> 0.12.2)
4
+ locomotivecms_coal (1.7.0)
5
+ activesupport (>= 5.1.5, < 6.1)
6
+ faraday (~> 0.17)
7
+ faraday_middleware (~> 0.13.1)
8
8
  httpclient (~> 2.8.3)
9
- mime-types (~> 3.1.0)
9
+ mime-types (~> 3.3.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (5.2.2)
14
+ activesupport (6.0.3.4)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 0.7, < 2)
17
17
  minitest (~> 5.1)
18
18
  tzinfo (~> 1.1)
19
- addressable (2.5.2)
20
- public_suffix (>= 2.0.2, < 4.0)
21
- byebug (9.0.6)
22
- codeclimate-test-reporter (1.0.7)
23
- simplecov
24
- coderay (1.1.2)
25
- concurrent-ruby (1.1.4)
26
- coveralls (0.8.21)
19
+ zeitwerk (~> 2.2, >= 2.2.2)
20
+ addressable (2.7.0)
21
+ public_suffix (>= 2.0.2, < 5.0)
22
+ byebug (11.1.3)
23
+ coderay (1.1.3)
24
+ concurrent-ruby (1.1.7)
25
+ coveralls (0.8.23)
27
26
  json (>= 1.8, < 3)
28
- simplecov (~> 0.14.1)
27
+ simplecov (~> 0.16.1)
29
28
  term-ansicolor (~> 1.3)
30
- thor (~> 0.19.4)
29
+ thor (>= 0.19.4, < 2.0)
31
30
  tins (~> 1.6)
32
- crack (0.4.3)
33
- safe_yaml (~> 1.0.0)
34
- diff-lcs (1.3)
35
- docile (1.1.5)
36
- domain_name (0.5.20170404)
31
+ crack (0.4.4)
32
+ diff-lcs (1.4.4)
33
+ docile (1.3.2)
34
+ domain_name (0.5.20190701)
37
35
  unf (>= 0.0.5, < 1.0.0)
38
- faraday (0.15.4)
36
+ faraday (0.17.3)
39
37
  multipart-post (>= 1.2, < 3)
40
- faraday_middleware (0.12.2)
38
+ faraday_middleware (0.13.1)
41
39
  faraday (>= 0.7.4, < 1.0)
42
- hashdiff (0.3.7)
40
+ hashdiff (1.0.1)
43
41
  http-cookie (1.0.3)
44
42
  domain_name (~> 0.5)
45
43
  httpclient (2.8.3)
46
- i18n (1.2.0)
44
+ i18n (1.8.5)
47
45
  concurrent-ruby (~> 1.0)
48
- json (2.1.0)
46
+ json (2.3.1)
49
47
  json_spec (1.1.5)
50
48
  multi_json (~> 1.0)
51
49
  rspec (>= 2.0, < 4.0)
52
- method_source (0.9.0)
53
- mime-types (3.1)
50
+ method_source (1.0.0)
51
+ mime-types (3.3.1)
54
52
  mime-types-data (~> 3.2015)
55
- mime-types-data (3.2016.0521)
56
- minitest (5.11.3)
57
- multi_json (1.13.1)
58
- multipart-post (2.0.0)
53
+ mime-types-data (3.2020.1104)
54
+ minitest (5.14.2)
55
+ multi_json (1.15.0)
56
+ multipart-post (2.1.1)
59
57
  netrc (0.11.0)
60
- pry (0.11.3)
61
- coderay (~> 1.1.0)
62
- method_source (~> 0.9.0)
63
- pry-byebug (3.4.3)
64
- byebug (>= 9.0, < 9.1)
65
- pry (~> 0.10)
66
- public_suffix (3.0.2)
67
- rake (12.3.0)
58
+ pry (0.13.1)
59
+ coderay (~> 1.1)
60
+ method_source (~> 1.0)
61
+ pry-byebug (3.9.0)
62
+ byebug (~> 11.0)
63
+ pry (~> 0.13.0)
64
+ public_suffix (4.0.6)
65
+ rake (13.0.1)
68
66
  rest-client (2.0.2)
69
67
  http-cookie (>= 1.0.2, < 2.0)
70
68
  mime-types (>= 1.16, < 4.0)
@@ -82,46 +80,43 @@ GEM
82
80
  diff-lcs (>= 1.2.0, < 2.0)
83
81
  rspec-support (~> 3.5.0)
84
82
  rspec-support (3.5.0)
85
- safe_yaml (1.0.4)
86
- simplecov (0.14.1)
87
- docile (~> 1.1.0)
83
+ simplecov (0.16.1)
84
+ docile (~> 1.1)
88
85
  json (>= 1.8, < 3)
89
86
  simplecov-html (~> 0.10.0)
90
87
  simplecov-html (0.10.2)
91
- term-ansicolor (1.6.0)
88
+ sync (0.5.0)
89
+ term-ansicolor (1.7.1)
92
90
  tins (~> 1.0)
93
- thor (0.19.4)
91
+ thor (1.0.1)
94
92
  thread_safe (0.3.6)
95
- tins (1.16.3)
96
- tzinfo (1.2.5)
93
+ tins (1.26.0)
94
+ sync
95
+ tzinfo (1.2.8)
97
96
  thread_safe (~> 0.1)
98
97
  unf (0.1.4)
99
98
  unf_ext
100
- unf_ext (0.0.7.5)
101
- vcr (4.0.0)
102
- webmock (3.3.0)
99
+ unf_ext (0.0.7.7)
100
+ vcr (6.0.0)
101
+ webmock (3.9.5)
103
102
  addressable (>= 2.3.6)
104
103
  crack (>= 0.3.2)
105
- hashdiff
104
+ hashdiff (>= 0.4.0, < 2.0.0)
105
+ zeitwerk (2.4.1)
106
106
 
107
107
  PLATFORMS
108
108
  ruby
109
109
 
110
110
  DEPENDENCIES
111
- bundler (~> 1.16.1)
112
- codeclimate-test-reporter (~> 1.0.7)
113
111
  coveralls (~> 0.8.19)
114
112
  json_spec (~> 1.1.4)
115
113
  locomotivecms_coal!
116
- pry-byebug (~> 3.4.2)
117
- rake (~> 12.3.0)
114
+ pry-byebug (~> 3.9.0)
115
+ rake (~> 13.0.1)
118
116
  rest-client (~> 2.0.2)
119
117
  rspec (~> 3.5.0)
120
118
  vcr
121
119
  webmock
122
120
 
123
- RUBY VERSION
124
- ruby 2.5.0p0
125
-
126
121
  BUNDLED WITH
127
- 1.16.1
122
+ 2.1.4
data/MIT-LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 NoCoffee
3
+ Copyright (c) 2020 NoCoffee
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Coal
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/locomotivecms/coal/badges/gpa.svg)](https://codeclimate.com/github/locomotivecms/coal) [![Dependency Status](https://gemnasium.com/locomotivecms/coal.svg)](https://gemnasium.com/locomotivecms/coal) [![Build Status](https://travis-ci.org/locomotivecms/coal.svg?branch=master)](https://travis-ci.org/locomotivecms/coal) [![Coverage Status](https://coveralls.io/repos/locomotivecms/coal/badge.svg?branch=master)](https://coveralls.io/r/locomotivecms/coal?branch=master)
3
+ [![Code Climate](https://codeclimate.com/github/locomotivecms/coal/badges/gpa.svg)](https://codeclimate.com/github/locomotivecms/coal) [![Build Status](https://travis-ci.org/locomotivecms/coal.svg?branch=master)](https://travis-ci.org/locomotivecms/coal) [![Coverage Status](https://coveralls.io/repos/github/locomotivecms/coal/badge.svg?branch=master)](https://coveralls.io/github/locomotivecms/coal?branch=master)
4
4
 
5
- The Ruby API Client for LocomotiveCMS V3.
5
+ The Ruby API Client for LocomotiveCMS V4.
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -11,6 +11,7 @@ The Ruby API Client for LocomotiveCMS V3.
11
11
  - [Authentication](#authentication)
12
12
  - [Resources](#resources)
13
13
  - [MyAccount](#my-account)
14
+ - [Accounts](#accounts)
14
15
  - [Sites](#sites)
15
16
  - [Pages](#pages)
16
17
  - [Content Types](#content-types)
@@ -69,6 +70,19 @@ We do not garantee that all the API resources will work with the V2 Client but P
69
70
 
70
71
  client.my_account.update(name: 'Jane Doe')
71
72
 
73
+ #### Accounts
74
+
75
+ **Only available for super administrators in the LocomotiveCMS engine**
76
+
77
+ **Create**
78
+
79
+ new_customer = client.accounts.create(name: 'John', email: 'johnn@doe.net', password: 'easyone', password_confirmation: 'easyone')
80
+ puts new_customer.name + " / " + my_account.email
81
+
82
+ **Update an account**
83
+
84
+ client.accounts.update(new_customer._id, name: 'Jane')
85
+
72
86
  #### Sites
73
87
 
74
88
  **Get all my sites**
@@ -149,7 +163,7 @@ It is required when we need the id of an existing page according to its fullpath
149
163
 
150
164
  *Note:* You can also use the following syntax
151
165
 
152
- content_type = site_client.contents.projects
166
+ content_type = site_client.contents.by_slug('projects')
153
167
  articles = site_client.content_entries(content_type).all
154
168
 
155
169
  **Create a content entry**
@@ -282,7 +296,7 @@ To get the snippets in the FR locale:
282
296
 
283
297
  **Update a membership**
284
298
 
285
- site_client.memberships.update(account_email: 'nic@example.com', role: 'admin')
299
+ site_client.memberships.update(membership._id, role: 'designer')
286
300
 
287
301
  **Destroy a membership**
288
302
 
@@ -316,10 +330,11 @@ Check the issues section of the repository to see what is missing.
316
330
  - edit your /etc/hosts file (*NIX systems) and add 2 lines
317
331
  127.0.0.0 www.example.com acme.example.com
318
332
 
333
+
319
334
  ## Credits
320
335
 
321
336
  [Christian](https://github.com/cblavier), [Greg](https://github.com/gregKawet) and [Ben](https://github.com/stiiig) from the Cogip/Insert International LTD who brainstormed with me (a very long time) to find this awesome name.
322
337
 
323
338
  ## License
324
339
 
325
- Copyright (c) 2018 NoCoffee. MIT Licensed, see LICENSE for details.
340
+ Copyright (c) 2020 NoCoffee. MIT Licensed, see LICENSE for details.
@@ -21,10 +21,18 @@ module Locomotive::Coal
21
21
  @my_account ||= Resources::MyAccount.new(uri, connection)
22
22
  end
23
23
 
24
+ def accounts
25
+ @accounts ||= Resources::Accounts.new(uri, connection)
26
+ end
27
+
24
28
  def sites
25
29
  @sites ||= Resources::Sites.new(uri, connection)
26
30
  end
27
31
 
32
+ def memberships
33
+ @memberships ||= Resources::Memberships.new(uri, connection)
34
+ end
35
+
28
36
  def current_site
29
37
  @current_site ||= Resources::CurrentSite.new(uri, connection)
30
38
  end
@@ -0,0 +1,33 @@
1
+ module Locomotive::Coal
2
+ module Resources
3
+
4
+ class Accounts < Base
5
+
6
+ def index(query = nil, options = {})
7
+ parameters = { where: (query || {}).to_json }.merge(options || {})
8
+
9
+ response = get(resources_name, parameters, true)
10
+
11
+ list = response.body.map { |attributes| Resource.new(attributes) }
12
+
13
+ PaginatedResources.new(list,
14
+ options[:page] || 1,
15
+ response.headers[:x_total_pages].to_i,
16
+ response.headers[:x_total_entries].to_i)
17
+ end
18
+
19
+ def each(query = nil, options = nil, &block)
20
+ page = 1
21
+ while page do
22
+ resources = all(query, (options || {}).merge(page: page))
23
+ resources.each(&block)
24
+ page = resources._next_page
25
+ end
26
+ end
27
+
28
+ alias :all :index
29
+
30
+ end
31
+
32
+ end
33
+ end
@@ -20,10 +20,28 @@ module Locomotive::Coal::Resources
20
20
  end
21
21
 
22
22
  def do_request(action, endpoint, parameters = {}, raw = false)
23
+ max_count = 5
23
24
  response = begin
25
+ # Just uncomment following line if you want to trace protocol between wagon & engine live
26
+ # puts "#{parameters}"
24
27
  _do_request(action, "#{uri.path}/#{endpoint}.json", parameters)
25
28
  rescue ::Timeout::Error, ::Errno::ETIMEDOUT, Faraday::Error::TimeoutError => e
26
- raise Locomotive::Coal::TimeoutError.new(e)
29
+ if max_count > 0
30
+ puts "\n Warning => timeout detected, attempts left: #{max_count}\n\n"
31
+ max_count -= 1
32
+ retry
33
+ else
34
+ raise Locomotive::Coal::TimeoutError.new(e)
35
+ end
36
+ rescue HTTPClient::KeepAliveDisconnected => e
37
+ if max_count > 0
38
+ puts "\n Warning => HTTPClient::KeepAliveDisconnected exception detected, attempts left: #{max_count}\n\n"
39
+ max_count -= 1
40
+ retry
41
+ else
42
+ puts "\n Error => HTTPClient::KeepAliveDisconnected exception detected, attempts left zero... raising exception\n\n"
43
+ raise HTTPClient::KeepAliveDisconnected.new(e)
44
+ end
27
45
  rescue Locomotive::Coal::Error
28
46
  raise
29
47
  rescue Exception => e
@@ -3,6 +3,6 @@
3
3
  # 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0
4
4
  module Locomotive
5
5
  module Coal
6
- VERSION = '1.6.0.beta1'
6
+ VERSION = '1.7.0'
7
7
  end
8
8
  end
@@ -18,6 +18,7 @@ require_relative 'coal/resource'
18
18
  require_relative 'coal/resources/base'
19
19
  require_relative 'coal/resources/token'
20
20
  require_relative 'coal/resources/my_account'
21
+ require_relative 'coal/resources/accounts'
21
22
  require_relative 'coal/resources/sites'
22
23
  require_relative 'coal/resources/current_site'
23
24
  require_relative 'coal/resources/pages'
@@ -15,14 +15,13 @@ Gem::Specification.new do |spec|
15
15
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
16
  spec.require_paths = ['lib']
17
17
 
18
- spec.add_development_dependency 'bundler', '~> 1.16.1'
19
- spec.add_development_dependency 'rake', '~> 12.3.0'
18
+ spec.add_development_dependency 'rake', '~> 13.0.1'
20
19
 
21
20
  spec.add_dependency 'httpclient', '~> 2.8.3'
22
- spec.add_dependency 'faraday', '~> 0.15.4'
23
- spec.add_dependency 'faraday_middleware', '~> 0.12.2'
24
- spec.add_dependency 'activesupport', '>= 5.1.5', '< 6.0'
25
- spec.add_dependency 'mime-types', '~> 3.1.0'
21
+ spec.add_dependency 'faraday', '~> 0.17'
22
+ spec.add_dependency 'faraday_middleware', '~> 0.13.1'
23
+ spec.add_dependency 'activesupport', '>= 5.1.5', '< 6.1'
24
+ spec.add_dependency 'mime-types', '~> 3.3.0'
26
25
 
27
26
  spec.required_ruby_version = '>= 2.0'
28
27
  end
@@ -0,0 +1,214 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:3000/locomotive/api/v3/tokens.json
6
+ body:
7
+ encoding: UTF-8
8
+ string: email=admin%40locomotivecms.com&password=locomotive
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Accept:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip,deflate
16
+ Date:
17
+ - Sun, 17 Nov 2019 16:39:31 GMT
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Content-Type:
26
+ - application/json
27
+ Content-Length:
28
+ - '32'
29
+ Connection:
30
+ - keep-alive
31
+ Status:
32
+ - 201 Created
33
+ Cache-Control:
34
+ - max-age=0, private, must-revalidate
35
+ Etag:
36
+ - W/"410e3d6fde24f39257a7cc619b61baa7"
37
+ X-Runtime:
38
+ - '0.003847'
39
+ X-Request-Id:
40
+ - 37641f2b-e3b4-4c75-a947-67001077f519
41
+ Date:
42
+ - Sun, 17 Nov 2019 16:39:31 GMT
43
+ X-Powered-By:
44
+ - Phusion Passenger 6.0.4
45
+ Server:
46
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"token":"bzwAyFQzcchf_hgDQhz3"}'
50
+ http_version:
51
+ recorded_at: Sun, 17 Nov 2019 16:39:31 GMT
52
+ - request:
53
+ method: get
54
+ uri: http://localhost:3000/locomotive/api/v3/accounts.json?auth_token=bzwAyFQzcchf_hgDQhz3&where=%7B%7D
55
+ body:
56
+ encoding: UTF-8
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.15.4
61
+ Accept:
62
+ - application/json
63
+ Accept-Encoding:
64
+ - gzip,deflate
65
+ Date:
66
+ - Sun, 17 Nov 2019 16:39:31 GMT
67
+ X-Locomotive-Account-Email:
68
+ - admin@locomotivecms.com
69
+ X-Locomotive-Account-Token:
70
+ - bzwAyFQzcchf_hgDQhz3
71
+ response:
72
+ status:
73
+ code: 200
74
+ message: OK
75
+ headers:
76
+ Content-Type:
77
+ - application/json
78
+ Transfer-Encoding:
79
+ - chunked
80
+ Connection:
81
+ - keep-alive
82
+ Status:
83
+ - 200 OK
84
+ Cache-Control:
85
+ - max-age=0, private, must-revalidate
86
+ Etag:
87
+ - W/"b45c198e9ff3646c60b8055f5230fe83"
88
+ X-Runtime:
89
+ - '0.011734'
90
+ X-Request-Id:
91
+ - 5467f046-9d4c-49af-86aa-3ac502e50b13
92
+ Date:
93
+ - Sun, 17 Nov 2019 16:39:31 GMT
94
+ X-Powered-By:
95
+ - Phusion Passenger 6.0.4
96
+ Server:
97
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
98
+ Content-Encoding:
99
+ - gzip
100
+ body:
101
+ encoding: UTF-8
102
+ string: '[{"_id":"5dd1779ba95330a94bf7253c","created_at":"2019-11-17T16:38:51Z","updated_at":"2019-11-17T16:39:30Z","name":"John
103
+ Doe","email":"admin@locomotivecms.com","locale":"en","api_key":"d49cd50f6f0d2b163f48fc73cb249f0244c37074","super_admin":true,"local_admin":true},{"_id":"5dd1779ba95330a94bf7253d","created_at":"2019-11-17T16:38:51Z","updated_at":"2019-11-17T16:38:51Z","name":"New
104
+ Admin","email":"new_admin@locomotivecms.com","locale":"en","api_key":"d49cd50f6f0d2b163f48fc73cb249f0244c37074","super_admin":false,"local_admin":false},{"_id":"5dd177c2a95330aa17f8f8df","created_at":"2019-11-17T16:39:30Z","updated_at":"2019-11-17T16:39:30Z","name":"Jack
105
+ Doe","email":"jack@doe.net","locale":"en","api_key":"b99855e630e7510ee902e0871f213328cfcbc552","super_admin":false,"local_admin":false}]'
106
+ http_version:
107
+ recorded_at: Sun, 17 Nov 2019 16:39:31 GMT
108
+ - request:
109
+ method: post
110
+ uri: http://localhost:3000/locomotive/api/v3/accounts.json
111
+ body:
112
+ encoding: UTF-8
113
+ string: account%5Bemail%5D=jane%40doe.net&account%5Bname%5D=Jane&account%5Bpassword%5D=easyone&account%5Bpassword_confirmation%5D=easyone&auth_token=bzwAyFQzcchf_hgDQhz3
114
+ headers:
115
+ User-Agent:
116
+ - Faraday v0.15.4
117
+ Accept:
118
+ - application/json
119
+ Accept-Encoding:
120
+ - gzip,deflate
121
+ Date:
122
+ - Sun, 17 Nov 2019 16:39:32 GMT
123
+ X-Locomotive-Account-Email:
124
+ - admin@locomotivecms.com
125
+ X-Locomotive-Account-Token:
126
+ - bzwAyFQzcchf_hgDQhz3
127
+ Content-Type:
128
+ - application/x-www-form-urlencoded
129
+ response:
130
+ status:
131
+ code: 201
132
+ message: Created
133
+ headers:
134
+ Content-Type:
135
+ - application/json
136
+ Content-Length:
137
+ - '250'
138
+ Connection:
139
+ - keep-alive
140
+ Status:
141
+ - 201 Created
142
+ Cache-Control:
143
+ - max-age=0, private, must-revalidate
144
+ Etag:
145
+ - W/"93c7e6382bd0ad95a3e47fac8db86283"
146
+ X-Runtime:
147
+ - '0.014507'
148
+ X-Request-Id:
149
+ - 4643a202-a742-423f-8f83-a39b66034328
150
+ Date:
151
+ - Sun, 17 Nov 2019 16:39:32 GMT
152
+ X-Powered-By:
153
+ - Phusion Passenger 6.0.4
154
+ Server:
155
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
156
+ body:
157
+ encoding: UTF-8
158
+ string: '{"_id":"5dd177c4a95330aa17f8f8e7","created_at":"2019-11-17T16:39:32Z","updated_at":"2019-11-17T16:39:32Z","name":"Jane","email":"jane@doe.net","locale":"en","api_key":"55ce1c667d4da4509641fc5bcecd8e4542b72d76","super_admin":false,"local_admin":false}'
159
+ http_version:
160
+ recorded_at: Sun, 17 Nov 2019 16:39:32 GMT
161
+ - request:
162
+ method: delete
163
+ uri: http://localhost:3000/locomotive/api/v3/accounts/5dd177c4a95330aa17f8f8e7.json?auth_token=bzwAyFQzcchf_hgDQhz3
164
+ body:
165
+ encoding: UTF-8
166
+ string: ''
167
+ headers:
168
+ User-Agent:
169
+ - Faraday v0.15.4
170
+ Accept:
171
+ - application/json
172
+ Accept-Encoding:
173
+ - gzip,deflate
174
+ Date:
175
+ - Sun, 17 Nov 2019 16:39:32 GMT
176
+ X-Locomotive-Account-Email:
177
+ - admin@locomotivecms.com
178
+ X-Locomotive-Account-Token:
179
+ - bzwAyFQzcchf_hgDQhz3
180
+ response:
181
+ status:
182
+ code: 200
183
+ message: OK
184
+ headers:
185
+ Content-Type:
186
+ - application/json
187
+ Transfer-Encoding:
188
+ - chunked
189
+ Connection:
190
+ - keep-alive
191
+ Status:
192
+ - 200 OK
193
+ Cache-Control:
194
+ - max-age=0, private, must-revalidate
195
+ Etag:
196
+ - W/"93c7e6382bd0ad95a3e47fac8db86283"
197
+ X-Runtime:
198
+ - '0.019832'
199
+ X-Request-Id:
200
+ - 5e0ae3a4-71ea-4235-aaf4-1ce98404e225
201
+ Date:
202
+ - Sun, 17 Nov 2019 16:39:32 GMT
203
+ X-Powered-By:
204
+ - Phusion Passenger 6.0.4
205
+ Server:
206
+ - nginx/1.17.3 + Phusion Passenger 6.0.4
207
+ Content-Encoding:
208
+ - gzip
209
+ body:
210
+ encoding: UTF-8
211
+ string: '{"_id":"5dd177c4a95330aa17f8f8e7","created_at":"2019-11-17T16:39:32Z","updated_at":"2019-11-17T16:39:32Z","name":"Jane","email":"jane@doe.net","locale":"en","api_key":"55ce1c667d4da4509641fc5bcecd8e4542b72d76","super_admin":false,"local_admin":false}'
212
+ http_version:
213
+ recorded_at: Sun, 17 Nov 2019 16:39:32 GMT
214
+ recorded_with: VCR 4.0.0