chatmeter 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/chatmeter.gemspec +41 -0
- data/lib/chatmeter/api/account.rb +46 -0
- data/lib/chatmeter/api/campaign.rb +60 -0
- data/lib/chatmeter/api/errors.rb +23 -0
- data/lib/chatmeter/api/group.rb +62 -0
- data/lib/chatmeter/api/location.rb +63 -0
- data/lib/chatmeter/api/login.rb +14 -0
- data/lib/chatmeter/api/mock/account.rb +47 -0
- data/lib/chatmeter/api/mock/campaign.rb +141 -0
- data/lib/chatmeter/api/mock/group.rb +78 -0
- data/lib/chatmeter/api/mock/location.rb +273 -0
- data/lib/chatmeter/api/mock/login.rb +18 -0
- data/lib/chatmeter/api/mock/review.rb +368 -0
- data/lib/chatmeter/api/mock/single_signon.rb +18 -0
- data/lib/chatmeter/api/mock/user_group_access.rb +41 -0
- data/lib/chatmeter/api/mock/user_location_access.rb +38 -0
- data/lib/chatmeter/api/mock/user_management.rb +108 -0
- data/lib/chatmeter/api/mock.rb +39 -0
- data/lib/chatmeter/api/review.rb +84 -0
- data/lib/chatmeter/api/single_signon.rb +14 -0
- data/lib/chatmeter/api/user_group_access.rb +33 -0
- data/lib/chatmeter/api/user_location_access.rb +36 -0
- data/lib/chatmeter/api/user_management.rb +89 -0
- data/lib/chatmeter/api.rb +92 -0
- data/lib/chatmeter/version.rb +3 -0
- data/lib/chatmeter.rb +1 -0
- metadata +180 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9d64e8edc503a5cdd9b9256468e41457be841a6e61db78dde68c7b781c5e9432
|
4
|
+
data.tar.gz: 6db45a0fea8f7f2cc138a3556c2e0bcc74e495b6cabdaf7343c8d625d9252940
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 357cfee8a87a64507990677d240339351d40ae3b0079d8020171034e3e68e2e77e598285cf7fdb94b97a7488bc04be93bd7243498bb4a7d47600814483654232
|
7
|
+
data.tar.gz: f2fbb3b6e4dc06e490410f935eb16bed8cfc5978537e976a992c7f190608caf44e56c40b4a6b49b8ee7e10fe263d4c395b751363d434d7fe965de6507508a8e8
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at levi.brown@getg5.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Levi Brown
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Chatmeter
|
2
|
+
|
3
|
+
A ruby api wrapper for chatmeters REST API http://newapi.chatmeter.com/
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'chatmeter'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install chatmeter
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```
|
24
|
+
require 'chatmeter'
|
25
|
+
chatmeter = Chatmeter::API.new(:username => USERNAME, :password => PASSWORD)
|
26
|
+
```
|
27
|
+
|
28
|
+
## Development
|
29
|
+
|
30
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
31
|
+
|
32
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
33
|
+
|
34
|
+
## Contributing
|
35
|
+
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/G5/chatmeter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "chatmeter"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/chatmeter.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "chatmeter/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "chatmeter"
|
8
|
+
spec.version = Chatmeter::VERSION
|
9
|
+
spec.authors = ["Levi Brown", "Kyle Rose", "Pablo Rodriguez"]
|
10
|
+
spec.email = ["levi.brown@getg5.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{A ruby wrapper for the chatmeter API.}
|
13
|
+
spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/G5/chatmeter"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
"public gem pushes."
|
24
|
+
end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
spec.add_development_dependency "pry"
|
37
|
+
|
38
|
+
spec.add_dependency "multi_json"
|
39
|
+
spec.add_dependency "excon"
|
40
|
+
spec.add_dependency "json"
|
41
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
|
4
|
+
# GET /accounts for user
|
5
|
+
def get_accounts_for_user(user_id)
|
6
|
+
request(
|
7
|
+
expects: 200,
|
8
|
+
method: :get,
|
9
|
+
path: "/accounts/forUser/#{user_id}"
|
10
|
+
)[:accountIds]
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /accounts
|
14
|
+
def accounts(query={})
|
15
|
+
request(
|
16
|
+
expects: 200,
|
17
|
+
method: :get,
|
18
|
+
path: '/accounts',
|
19
|
+
query: query
|
20
|
+
)[:accounts]
|
21
|
+
end
|
22
|
+
|
23
|
+
# POST /accounts
|
24
|
+
def add_new_account(params)
|
25
|
+
request(
|
26
|
+
expects: 200,
|
27
|
+
method: :post,
|
28
|
+
path: "/accounts",
|
29
|
+
body: params.to_json
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# GET account's groups
|
34
|
+
def get_account_groups(account_id)
|
35
|
+
request(
|
36
|
+
expects: 200,
|
37
|
+
method: :get,
|
38
|
+
path: "/groups",
|
39
|
+
query: {
|
40
|
+
accountId: account_id
|
41
|
+
}
|
42
|
+
)[:groups]
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
|
4
|
+
# GET /reviewBuilder/campaign/get
|
5
|
+
def list_all_campaigns
|
6
|
+
request(
|
7
|
+
expects: 200,
|
8
|
+
method: :get,
|
9
|
+
path: "/reviewBuilder/campaign/get"
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
# POST /reviewBuilder/campaign/create
|
14
|
+
def create_new_campaign(params)
|
15
|
+
request(
|
16
|
+
expects: 201,
|
17
|
+
method: :post,
|
18
|
+
path: "/reviewBuilder/campaign/create",
|
19
|
+
body: params.to_json
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /reviewBuilder/campaign/get/{campaignId}
|
24
|
+
def get_campaign_by_id(campaign_id)
|
25
|
+
request(
|
26
|
+
expects: 200,
|
27
|
+
method: :get,
|
28
|
+
path: "/reviewBuilder/campaign/get/#{campaign_id}"
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
# PUT /reviewBuilder/campaign/{campaignId}
|
33
|
+
def update_campaign(campaign_id, params)
|
34
|
+
request(
|
35
|
+
expects: 200,
|
36
|
+
method: :put,
|
37
|
+
path: "/reviewBuilder/campaign/#{campaign_id}",
|
38
|
+
body: params.to_json
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
# GET /reviewBuilder/campaign
|
43
|
+
def search_campaign(params={})
|
44
|
+
request(
|
45
|
+
expects: 200,
|
46
|
+
method: :get,
|
47
|
+
path: "/reviewBuilder/campaign?#{params.to_query}"
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# DELETE /reviewBuilder/campaign/delete/{campaignId}
|
52
|
+
def delete_campaign(campaign_id)
|
53
|
+
request(
|
54
|
+
expects: 200,
|
55
|
+
method: :delete,
|
56
|
+
path: "/reviewBuilder/campaign/delete/#{campaign_id}"
|
57
|
+
)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
module Errors
|
4
|
+
class Error < StandardError; end
|
5
|
+
|
6
|
+
class ErrorWithResponse < Error
|
7
|
+
attr_reader :response
|
8
|
+
|
9
|
+
def initialize(message, response)
|
10
|
+
message = message << "\nbody: #{response.body.inspect}"
|
11
|
+
super message
|
12
|
+
@response = response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class NotFound < ErrorWithResponse; end
|
17
|
+
class BadRequest < ErrorWithResponse; end
|
18
|
+
class Unauthorized < ErrorWithResponse; end
|
19
|
+
class Forbidden < ErrorWithResponse; end
|
20
|
+
class InternalServerError < ErrorWithResponse; end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
|
4
|
+
# GET /groups
|
5
|
+
def list_all_groups
|
6
|
+
request(
|
7
|
+
expects: 200,
|
8
|
+
method: :get,
|
9
|
+
path: "/groups"
|
10
|
+
)[:groups]
|
11
|
+
end
|
12
|
+
|
13
|
+
# POST /groups
|
14
|
+
def create_new_group(params)
|
15
|
+
request(
|
16
|
+
expects: 200,
|
17
|
+
method: :post,
|
18
|
+
path: "/groups",
|
19
|
+
body: params.to_json
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
# PUT /groups/{group_id}
|
24
|
+
def update_group(group_id, params)
|
25
|
+
request(
|
26
|
+
expects: 200,
|
27
|
+
method: :put,
|
28
|
+
path: "/groups/#{group_id}",
|
29
|
+
body: params.to_json
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# DELETE /groups/{group_id}
|
34
|
+
def delete_group(group_id)
|
35
|
+
request(
|
36
|
+
expects: 200,
|
37
|
+
method: :delete,
|
38
|
+
path: "/groups/#{group_id}"
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
# POST /groups/{group_id}/locations
|
43
|
+
def update_group_locations(group_id, params)
|
44
|
+
request(
|
45
|
+
expects: 200,
|
46
|
+
method: :post,
|
47
|
+
path: "/groups/#{group_id}/locations",
|
48
|
+
body: params.to_json
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# DELETE /groups/{group_id}/locations
|
53
|
+
def delete_group_locations(group_id,locationsIds)
|
54
|
+
request(
|
55
|
+
expects: 200,
|
56
|
+
method: :delete,
|
57
|
+
path: "/groups/#{group_id}/locations?locationIds=#{locationsIds.join(',')}"
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
|
4
|
+
# GET /locations
|
5
|
+
def get_all_locations(query={})
|
6
|
+
request(
|
7
|
+
expects: 200,
|
8
|
+
method: :get,
|
9
|
+
path: '/locations',
|
10
|
+
query: query
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /locations/externalId/{resellerLocationId}
|
15
|
+
def get_locations_by_reseller_location_id(reseller_location_id)
|
16
|
+
request(
|
17
|
+
expects: 200,
|
18
|
+
method: :get,
|
19
|
+
path: "/locations/externalId/#{reseller_location_id}"
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
# POST /locations
|
24
|
+
def add_new_location(fields)
|
25
|
+
request(
|
26
|
+
expects: 200,
|
27
|
+
method: :post,
|
28
|
+
path: '/locations',
|
29
|
+
body: fields.to_json
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# PUT /locations/{locationId}
|
34
|
+
def update_location(location_id, fields)
|
35
|
+
request(
|
36
|
+
expects: 200,
|
37
|
+
method: :put,
|
38
|
+
path: "/locations/#{location_id}",
|
39
|
+
body: fields.to_json
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
# DELETE /locations/{locationId}
|
44
|
+
def delete_location(location_id)
|
45
|
+
request(
|
46
|
+
expects: 200,
|
47
|
+
method: :delete,
|
48
|
+
path: "/locations/#{location_id}"
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# PUT /locations/restore (array)
|
53
|
+
def restore_location(location_ids)
|
54
|
+
request(
|
55
|
+
expects: 200,
|
56
|
+
method: :put,
|
57
|
+
path: '/locations/restore',
|
58
|
+
body: location_ids.to_json
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Chatmeter
|
2
|
+
class API
|
3
|
+
module Mock
|
4
|
+
|
5
|
+
# stub GET /accounts
|
6
|
+
Excon.stub(expects: 200, method: :get, path: '/v5/accounts') do |params|
|
7
|
+
request_params, mock_data = parse_stub_params(params)
|
8
|
+
{
|
9
|
+
body: {
|
10
|
+
accounts: [
|
11
|
+
{
|
12
|
+
id: "23232",
|
13
|
+
accountName: "Reseller 1"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
hasMore: false
|
17
|
+
},
|
18
|
+
status: 200
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
# stub GET /accounts
|
23
|
+
Excon.stub(expects: 200, method: :get, path: %r{\/v5\/accounts\/forUser\/\w*$}) do |params|
|
24
|
+
request_params, mock_data = parse_stub_params(params)
|
25
|
+
{
|
26
|
+
body: {
|
27
|
+
accountIds: [ "232323" ]
|
28
|
+
},
|
29
|
+
status: 200
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# stub POST /accounts
|
34
|
+
Excon.stub(expects: 200, method: :post, path: %r{^/v5/accounts}) do |params|
|
35
|
+
params = JSON.parse(params[:body])
|
36
|
+
{
|
37
|
+
body: {
|
38
|
+
id: "23232",
|
39
|
+
accountName: params["accountName"]
|
40
|
+
},
|
41
|
+
status: 200
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|