action_kit_rest 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 0e6edb307a9b65f7e81288ac4e14b9a80abe777c
4
- data.tar.gz: 629f250827cd651dbe0ef532a22419e577be2d48
3
+ metadata.gz: 95167f59f12c0e509c151c8d247b1199f7dfdc1e
4
+ data.tar.gz: ea10483ad8e5a5d3aa084d8b6452b0db61a21c68
5
5
  SHA512:
6
- metadata.gz: 248b87b48c6645107eea166d107371056d8ee01ccdd2198d0bf2e5decbee4b99bc2dc63a4ddff261f764807c43390785ff4b83dbd747a5082583bf0f7d698809
7
- data.tar.gz: 6291cfc494a1996c8a387599428acf958df52345bebd1f773348f55f6c53c30f5bec5ebed4e90c4b2079419730bbde8d2a4f5255889550c89081b960e1b42ba0
6
+ metadata.gz: e30f97aba76236d8aafd81531244673dd75bb80b0f30223b90ae884b16e7d0430492727207a7e05163f3926fc93fa9788dbaeb635c234b029666792188612dcc
7
+ data.tar.gz: efd0de3559026af4f3022c254ca04716c9f68edf4bb881b2db15631cd6db4fd3159f2336895a26f3795c5a2b93871dd0701123a38b8737e82141e3dc4d57b11b
@@ -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.1 ruby lib
5
+ # stub: action_kit_rest 0.3.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "action_kit_rest".freeze
9
- s.version = "0.3.1"
9
+ s.version = "0.3.2"
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 = "2017-09-04"
14
+ s.date = "2017-09-05"
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 = [
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
29
29
  "LICENSE.txt",
30
30
  "README.md",
31
31
  "Rakefile",
32
- "VERSION",
33
32
  "action_kit_rest.gemspec",
34
33
  "lib/action_kit_rest.rb",
35
34
  "lib/action_kit_rest/action.rb",
@@ -59,6 +58,8 @@ Gem::Specification.new do |s|
59
58
  "lib/action_kit_rest/tag.rb",
60
59
  "lib/action_kit_rest/user.rb",
61
60
  "lib/action_kit_rest/version.rb",
61
+ "spec/fixtures/action/event_create_action.json",
62
+ "spec/fixtures/action/event_signup_action.json",
62
63
  "spec/fixtures/error.json",
63
64
  "spec/fixtures/page/campaign.json",
64
65
  "spec/fixtures/page/collection.json",
@@ -69,6 +70,8 @@ Gem::Specification.new do |s|
69
70
  "spec/fixtures/phone/object.json",
70
71
  "spec/fixtures/user/object_with_phones.json",
71
72
  "spec/fixtures/user/object_without_phones.json",
73
+ "spec/lib/action_kit_rest/actions/event_create_action_spec.rb",
74
+ "spec/lib/action_kit_rest/actions/event_signup_action_spec.rb",
72
75
  "spec/lib/action_kit_rest/logger_spec.rb",
73
76
  "spec/lib/action_kit_rest/page_spec.rb",
74
77
  "spec/lib/action_kit_rest/pages/event_campaign_page_spec.rb",
@@ -4,6 +4,16 @@ module ActionKitRest
4
4
  def base_path
5
5
  'eventcreateaction'
6
6
  end
7
+
8
+ def get(id)
9
+ ak_event_create_action = super
10
+
11
+ # Aggregate fields parsed from referrenced entities' URI
12
+ ak_event_create_action.obj['event_id'] = ak_event_create_action.event.match(/\/rest\/v1\/event\/(\d*)\//)[1]
13
+ ak_event_create_action.obj['user_id'] = ak_event_create_action.user.match(/\/rest\/v1\/user\/(\d*)\//)[1]
14
+
15
+ ak_event_create_action
16
+ end
7
17
  end
8
18
  end
9
19
  end
@@ -4,6 +4,16 @@ module ActionKitRest
4
4
  def base_path
5
5
  'eventsignupaction'
6
6
  end
7
+
8
+ def get(id)
9
+ ak_event_signup_action = super
10
+
11
+ # Aggregate fields parsed from referrenced entities' URI
12
+ ak_event_signup_action.obj['event_signup_id'] = ak_event_signup_action.signup.match(/\/rest\/v1\/eventsignup\/(\d*)\//)[1]
13
+ ak_event_signup_action.obj['user_id'] = ak_event_signup_action.user.match(/\/rest\/v1\/user\/(\d*)\//)[1]
14
+
15
+ ak_event_signup_action
16
+ end
7
17
  end
8
18
  end
9
19
  end
@@ -2,7 +2,7 @@ module ActionKitRest
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -0,0 +1,24 @@
1
+ {
2
+ "akid": "xyz.abcd.123456",
3
+ "created_at": "2017-09-04T20:51:14",
4
+ "created_user": false,
5
+ "event": "/rest/v1/event/999/",
6
+ "fields": { "is_virtual": "0"},
7
+ "id": 12345,
8
+ "ip_address": "127.0.0.1",
9
+ "is_forwarded": false,
10
+ "link": null,
11
+ "mailing": null,
12
+ "opq_id": "",
13
+ "page": "/rest/v1/eventcreatepage/818/",
14
+ "referring_mailing": null,
15
+ "referring_user": null,
16
+ "resource_uri": "/rest/v1/eventcreateaction/12345/",
17
+ "source": "restful_api",
18
+ "status": "complete",
19
+ "subscribed_user": false,
20
+ "taf_emails_sent": null,
21
+ "type": "EventCreate",
22
+ "updated_at": "2017-09-04T20:51:15",
23
+ "user": "/rest/v1/user/112233/"
24
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "akid": "xyz.abcd.123456",
3
+ "created_at": "2017-12-01T21:27:33",
4
+ "created_user": false,
5
+ "fields": { "id": "54321"},
6
+ "id": 54321,
7
+ "ip_address": null,
8
+ "is_forwarded": false,
9
+ "link": null,
10
+ "mailing": null,
11
+ "opq_id": "",
12
+ "page": "/rest/v1/eventsignuppage/253/",
13
+ "referring_mailing": null,
14
+ "referring_user": "/rest/v1/user/111/",
15
+ "resource_uri": "/rest/v1/eventsignupaction/54321/",
16
+ "signup": "/rest/v1/eventsignup/888/",
17
+ "source": "restful_api",
18
+ "status": "complete",
19
+ "subscribed_user": false,
20
+ "taf_emails_sent": 1,
21
+ "type": "EventSignup",
22
+ "updated_at": "2012-02-23T20:26:24",
23
+ "user": "/rest/v1/user/111/"
24
+ }
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActionKitRest::Actions::EventCreateAction do
4
+ describe '#get' do
5
+ let(:actionkit) { ActionKitRest.new(host: 'test.com') }
6
+
7
+ before :each do
8
+ stub_request(:get, "https://test.com/rest/v1/eventcreateaction/123/")
9
+ .to_return(body: fixture('action/event_create_action.json'), status: '200', headers: {content_type: "application/json; charset=utf-8"})
10
+ end
11
+
12
+ it 'should retrieve eventcreateaction and aggregate parsed event and user IDs' do
13
+ ak_event_create_action = actionkit.event_create_action.get('123')
14
+
15
+ expect(ak_event_create_action.id).to eq(12345)
16
+ expect(ak_event_create_action.event_id).to eq('999')
17
+ expect(ak_event_create_action.user_id).to eq('112233')
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActionKitRest::Actions::EventSignupAction do
4
+ describe '#get' do
5
+ let(:actionkit) { ActionKitRest.new(host: 'test.com') }
6
+
7
+ before :each do
8
+ stub_request(:get, "https://test.com/rest/v1/eventsignupaction/54321/")
9
+ .to_return(body: fixture('action/event_signup_action.json'), status: '200', headers: {content_type: "application/json; charset=utf-8"})
10
+ end
11
+
12
+ it 'should retrieve eventsignupaction and aggregate parsed event sign-up and user IDs' do
13
+ ak_event_signup_action = actionkit.event_signup_action.get('54321')
14
+
15
+ expect(ak_event_signup_action.id).to eq(54321)
16
+ expect(ak_event_signup_action.event_signup_id).to eq('888')
17
+ expect(ak_event_signup_action.user_id).to eq('111')
18
+ end
19
+ end
20
+ end
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.1
4
+ version: 0.3.2
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: 2017-09-04 00:00:00.000000000 Z
13
+ date: 2017-09-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: vertebrae
@@ -156,7 +156,6 @@ files:
156
156
  - LICENSE.txt
157
157
  - README.md
158
158
  - Rakefile
159
- - VERSION
160
159
  - action_kit_rest.gemspec
161
160
  - lib/action_kit_rest.rb
162
161
  - lib/action_kit_rest/action.rb
@@ -186,6 +185,8 @@ files:
186
185
  - lib/action_kit_rest/tag.rb
187
186
  - lib/action_kit_rest/user.rb
188
187
  - lib/action_kit_rest/version.rb
188
+ - spec/fixtures/action/event_create_action.json
189
+ - spec/fixtures/action/event_signup_action.json
189
190
  - spec/fixtures/error.json
190
191
  - spec/fixtures/page/campaign.json
191
192
  - spec/fixtures/page/collection.json
@@ -196,6 +197,8 @@ files:
196
197
  - spec/fixtures/phone/object.json
197
198
  - spec/fixtures/user/object_with_phones.json
198
199
  - spec/fixtures/user/object_without_phones.json
200
+ - spec/lib/action_kit_rest/actions/event_create_action_spec.rb
201
+ - spec/lib/action_kit_rest/actions/event_signup_action_spec.rb
199
202
  - spec/lib/action_kit_rest/logger_spec.rb
200
203
  - spec/lib/action_kit_rest/page_spec.rb
201
204
  - spec/lib/action_kit_rest/pages/event_campaign_page_spec.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.3.1