purpose-platform-queued-client 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 067614e01170d414b7ab026c26083fcae19bdfe2
4
- data.tar.gz: 2a47cbf9a894d2dff1141b78c8e3800f44cff91c
3
+ metadata.gz: 1ff631d6e5daf27e7b35225013c3898bc77c6e3d
4
+ data.tar.gz: 71673bd595fe32d9851c2db502cdd5a499d91def
5
5
  SHA512:
6
- metadata.gz: e16cb5a7a19928aaf23c87ba1e050b213421b509ec19877299a5e5889465680c40872dcc9d29f6f5f03509690266ff9574e6ab847f12bf0692ff31480cec0d1d
7
- data.tar.gz: d3575f706209db81dfde2fb4277af874110e52e7fad65744fe04c32599e7b264e2609b59874322b3be131136d55a4aa302b886327847fe87de8f172af5fdce4e
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.2
1
+ 0.0.3
@@ -20,7 +20,7 @@ module PurposePlatformQueuedClient
20
20
  end
21
21
 
22
22
  def base_path
23
- 'action'
23
+ 'action'
24
24
  end
25
25
 
26
26
  def create(params)
@@ -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.2 ruby lib
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.2"
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-18"
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
  ]
@@ -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.2
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-18 00:00:00.000000000 Z
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