action_kit_rest 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d24d7ecd5f9cb702d4dbdbdcc26bc37ab1dfc0090f2fb4549dabf39dbaf91c87
|
4
|
+
data.tar.gz: 12b707b5a2c38d048060aeee7a6ec75381d55e6a7193bd483e9eacc9b855d1c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdaf0361faaaa5a8c64ac0c86e12ddec395480ebe05acb7d6a6363e6706d7ff6237f39ea0d76a19cde34abecd7466f6b806fa11b764de39a18449085a2e106fb
|
7
|
+
data.tar.gz: 81e7b01b4712966e4960423b67c4cdca85e6e03913b29716f47813d269936ab994d3d337916bd530d458915ef055a186e38ecd71cf24bdbdcb203cbd4683dfa4
|
data/action_kit_rest.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: action_kit_rest 0.3.
|
5
|
+
# stub: action_kit_rest 0.3.5 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "action_kit_rest".freeze
|
9
|
-
s.version = "0.3.
|
9
|
+
s.version = "0.3.5"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Nathan Woodhull".freeze, "Diego Marcet".freeze, "Jacinda Moore".freeze]
|
14
|
-
s.date = "2018-05-
|
14
|
+
s.date = "2018-05-21"
|
15
15
|
s.description = "Gem for interacting with the ActionKit API".freeze
|
16
16
|
s.email = "systems@controlshiftlabs.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -6,7 +6,12 @@ module ActionKitRest
|
|
6
6
|
status_code = response[:status].to_i
|
7
7
|
if (400...600).include? status_code
|
8
8
|
if status_code == 400
|
9
|
-
|
9
|
+
response_body = response[:body]
|
10
|
+
if JSON.parse(response_body)['errors'] == {'mailing_id' => ['Unable to associate this mailing ID with account.']}
|
11
|
+
raise ActionKitRest::Response::InvalidAkidError.new(url: response[:url].to_s, body: response_body)
|
12
|
+
else
|
13
|
+
raise ActionKitRest::Response::ValidationError.new(url: response[:url].to_s, body: response_body)
|
14
|
+
end
|
10
15
|
elsif status_code == 404
|
11
16
|
raise ActionKitRest::Response::NotFound.new(response[:url].to_s)
|
12
17
|
elsif status_code == 401
|
@@ -83,6 +83,15 @@ describe ActionKitRest::Page do
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
+
describe 'mailing ID error' do
|
87
|
+
let(:status) { 400 }
|
88
|
+
let(:body) { '{"errors": {"mailing_id": ["Unable to associate this mailing ID with account."]}}' }
|
89
|
+
|
90
|
+
it "should raise an Invalid AKID response error" do
|
91
|
+
lambda{ subject.page.get(1) }.should raise_exception(ActionKitRest::Response::InvalidAkidError)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
86
95
|
describe "an error" do
|
87
96
|
let(:status) { 500 }
|
88
97
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_kit_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-05-
|
13
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: vertebrae
|