engaging-networks-rest 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/engaging-networks-rest.gemspec +4 -4
- data/lib/engaging_networks_rest/client/pages.rb +2 -2
- data/spec/client/pages_spec.rb +8 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db0c015e012937ede5db4625ea71d77c575b5cfd61ff7fb907072189dc8fb3c3
|
4
|
+
data.tar.gz: 14a428937e13ef998ea0d12c5e9bd5cac547e98c1982ae6ee9a35b58f154f4d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1b6d1b710653f31ee22fd5f53b7201e084630a9c2a9b57b9a4e3ae98d66bfbaae9b549946ebd66e6c10ba349ca9142cd10023a41956e3f7fa0ab22a962cdc80
|
7
|
+
data.tar.gz: '08ddc74de227aaf3339aea4209df3f20570e5e12051e23caeca0d7dc53fdf7c93b29048558dcc1ab6f264c9fb59bfde08651676fd7a9c6a3135e00cfcb8c326c'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
@@ -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: engaging-networks-rest 0.
|
5
|
+
# stub: engaging-networks-rest 0.5.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "engaging-networks-rest".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.5.0"
|
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 = ["Jacinda Moore".freeze]
|
14
|
-
s.date = "2019-03-
|
14
|
+
s.date = "2019-03-12"
|
15
15
|
s.description = "Client gem for the ENS API to Engaging Networks".freeze
|
16
16
|
s.email = "jacinda@controlshiftlabs.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
]
|
41
41
|
s.homepage = "http://github.com/controlshift/engaging-networks-rest".freeze
|
42
42
|
s.licenses = ["MIT".freeze]
|
43
|
-
s.rubygems_version = "
|
43
|
+
s.rubygems_version = "3.0.3".freeze
|
44
44
|
s.summary = "Client gem for the ENS API to Engaging Networks".freeze
|
45
45
|
|
46
46
|
if s.respond_to? :specification_version then
|
@@ -14,8 +14,8 @@ module EngagingNetworksRest
|
|
14
14
|
get(path: "/ens/service/page/#{page_id}")
|
15
15
|
end
|
16
16
|
|
17
|
-
def process_page_request(page_id:, supporter_data:)
|
18
|
-
response = post(path: "/ens/service/page/#{page_id}/process", body:
|
17
|
+
def process_page_request(page_id:, supporter_data:, generic_data: {})
|
18
|
+
response = post(path: "/ens/service/page/#{page_id}/process", body: generic_data.merge(supporter: supporter_data))
|
19
19
|
if response['status'] == 'SUCCESS'
|
20
20
|
return response
|
21
21
|
end
|
data/spec/client/pages_spec.rb
CHANGED
@@ -60,6 +60,14 @@ describe EngagingNetworksRest::Client::Pages do
|
|
60
60
|
let(:failure_response) { {'status' => 'ERROR', 'message' => 'Something went wrong'} }
|
61
61
|
|
62
62
|
shared_examples_for 'process page request' do
|
63
|
+
it 'should send correct body for supporter and generic data' do
|
64
|
+
stub_request(:post, page_req_url)
|
65
|
+
.with(body: {'txn1' => 'foo', 'txn2' => 'bar', 'suppressAutoResponder' => true, supporter: { 'lastName' => 'Smith', 'emailAddress' => email }}.to_json, headers: standard_headers)
|
66
|
+
.to_return(status: '200', headers: {content_type: "application/json; charset=utf-8"}, body: response.to_json)
|
67
|
+
|
68
|
+
result = subject.process_page_request(page_id: page_id, generic_data: { 'txn1' => 'foo', 'txn2' => 'bar', 'suppressAutoResponder' => true }, supporter_data: { 'lastName' => 'Smith', 'emailAddress' => email })
|
69
|
+
end
|
70
|
+
|
63
71
|
it 'should process the page request and return its ID' do
|
64
72
|
stub_request(:post, page_req_url).with(body: {supporter: supporter_hash}.to_json, headers: standard_headers)
|
65
73
|
.to_return(status: '200', headers: {content_type: "application/json; charset=utf-8"}, body: response.to_json)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engaging-networks-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacinda Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -173,8 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
|
177
|
-
rubygems_version: 2.7.9
|
176
|
+
rubygems_version: 3.0.3
|
178
177
|
signing_key:
|
179
178
|
specification_version: 4
|
180
179
|
summary: Client gem for the ENS API to Engaging Networks
|