engaging-networks-rest 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c8fe675cfb462733d9a827b08f8714f6399d43649bdf92ee2e871d6516ed55f
4
- data.tar.gz: ba88d33736c1c1972281eb1f5c1c0e47278f619148173acd1a0ba63a0a93ad17
3
+ metadata.gz: db0c015e012937ede5db4625ea71d77c575b5cfd61ff7fb907072189dc8fb3c3
4
+ data.tar.gz: 14a428937e13ef998ea0d12c5e9bd5cac547e98c1982ae6ee9a35b58f154f4d0
5
5
  SHA512:
6
- metadata.gz: ff15125d0c3a29b05deb70bc0738e982b6d2a6fbabd2e7b2fb445b984f6dc461a0e33243f99ca4b11eeb6ea79be8589a080374d7094b403d3201f689366bff56
7
- data.tar.gz: 8de4bc283e4268841185ef724419a47395318562613b02f3389a346a8f7ca3b834668abf6440c857fd7ada7097bd2fc44b3b478d7e1fcd6fcaf9c4e388d040be
6
+ metadata.gz: a1b6d1b710653f31ee22fd5f53b7201e084630a9c2a9b57b9a4e3ae98d66bfbaae9b549946ebd66e6c10ba349ca9142cd10023a41956e3f7fa0ab22a962cdc80
7
+ data.tar.gz: '08ddc74de227aaf3339aea4209df3f20570e5e12051e23caeca0d7dc53fdf7c93b29048558dcc1ab6f264c9fb59bfde08651676fd7a9c6a3135e00cfcb8c326c'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
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.4.1 ruby lib
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.4.1"
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-11"
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 = "2.7.9".freeze
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: {supporter: supporter_data})
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
@@ -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.1
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 00:00:00.000000000 Z
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
- rubyforge_project:
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