purpose-platform-queued-client 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/purpose-platform-queued-client/action.rb +1 -1
- data/purpose-platform-queued-client.gemspec +4 -3
- data/spec/action_spec.rb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ff631d6e5daf27e7b35225013c3898bc77c6e3d
|
4
|
+
data.tar.gz: 71673bd595fe32d9851c2db502cdd5a499d91def
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f3bd5fe2fd397ec2220cd3d779365561ea8a4a7736473275bcb2b3d5b812751ba9aa2c3fcf88e8813569c91562e9becbca26469d97002d79dc0302a5f982e2a
|
7
|
+
data.tar.gz: 848e57d5d4f5d34b2a1424c6920b0676defbe3892729dbe77da21df93bda885bdfb9e392f2b116f76296b88c4fb70cfe04dcd924d894defa8d5f958ff173976b
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Ruby interface for the queued API service fronting the Purpose Platform which Fi
|
|
6
6
|
|
7
7
|
```ruby
|
8
8
|
pp = PurposePlatformQueuedClient.new(host: 'your.queued.purposeplatform.org')
|
9
|
-
pp.action.create(first_name: 'George', last_name: 'Washington', email: 'george@washington.com', org: 'foo')
|
9
|
+
pp.action.create(member: {first_name: 'George', last_name: 'Washington', email: 'george@washington.com', postcode: '11238', country: 'US'}, tag: 'bar', org: 'foo')
|
10
10
|
pp.unsubscribe.create(email: 'foo@bar.com')
|
11
11
|
```
|
12
12
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: purpose-platform-queued-client 0.0.
|
5
|
+
# stub: purpose-platform-queued-client 0.0.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "purpose-platform-queued-client"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Nathan Woodhull"]
|
14
|
-
s.date = "2015-08-
|
14
|
+
s.date = "2015-08-20"
|
15
15
|
s.description = "Ruby interface for the queued API service fronting the Purpose Platform which Fight for the Future uses."
|
16
16
|
s.email = "nathan@controlshiftlabs.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/purpose-platform-queued-client/client.rb",
|
36
36
|
"lib/purpose-platform-queued-client/unsubscribe.rb",
|
37
37
|
"purpose-platform-queued-client.gemspec",
|
38
|
+
"spec/action_spec.rb",
|
38
39
|
"spec/client_spec.rb",
|
39
40
|
"spec/spec_helper.rb"
|
40
41
|
]
|
data/spec/action_spec.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe PurposePlatformQueuedClient::Action do
|
4
|
+
subject { PurposePlatformQueuedClient.new(host: 'test.com') }
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
logger = double
|
8
|
+
allow(logger).to receive(:debug).and_return(true)
|
9
|
+
|
10
|
+
allow(PurposePlatformQueuedClient).to receive(:logger).and_return(logger)
|
11
|
+
allow(Vertebrae::Base).to receive(:logger).and_return(logger)
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:request_body) { {"guard"=>"", "hp_enabled"=>"true", "member"=>{"email"=>"george@washington.com", "first_name"=>"George", "last_name"=>"Washington", "postcode"=>"11238"}, "org"=>"foo"}}
|
15
|
+
let(:request_path) { '/action' }
|
16
|
+
let(:body) {'{"foo": "bar"}'}
|
17
|
+
|
18
|
+
describe "success" do
|
19
|
+
let(:status) { 200 }
|
20
|
+
|
21
|
+
before(:each) do
|
22
|
+
stub_post(request_path).with(body: request_body).to_return(:body => body, :status => status,
|
23
|
+
:headers => {:content_type => "application/json; charset=utf-8"})
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should return a single object" do
|
27
|
+
subject.action.create(member: {first_name: 'George', last_name: 'Washington', email: 'george@washington.com', postcode: '11238'}, org: 'foo')
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: purpose-platform-queued-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vertebrae
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/purpose-platform-queued-client/client.rb
|
148
148
|
- lib/purpose-platform-queued-client/unsubscribe.rb
|
149
149
|
- purpose-platform-queued-client.gemspec
|
150
|
+
- spec/action_spec.rb
|
150
151
|
- spec/client_spec.rb
|
151
152
|
- spec/spec_helper.rb
|
152
153
|
homepage: http://github.com/woodhull/purpose-platform-queued-client
|