actionkit_connector 0.3.0 → 0.4.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 +4 -4
- data/lib/actionkit_connector/version.rb +1 -1
- data/lib/actionkit_connector.rb +8 -0
- data/spec/connector_spec.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0536a04809c61a01c4c92e70b45e3c2bd52a4fe
|
4
|
+
data.tar.gz: 30ee7add2c690f34d8de58dc59875e5057c5596f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b87f08e2acf123cc58f1baf4e7e440fbaf69484f5a342284fb391ccc8080e06c82aefd423f43215565cc7ce9085354d9c1405b047058ba36159d5b836363251c
|
7
|
+
data.tar.gz: dec39a590b90edb6c6024791b9a7296fc9a75e2dcd01e5ea328f955cdecd7c019e532cbd4000437a3fadcda673873571e490771afb0ffa2fd55588fb5a203343
|
data/lib/actionkit_connector.rb
CHANGED
@@ -154,6 +154,14 @@ module ActionKitConnector
|
|
154
154
|
self.class.post(target, page_opts)
|
155
155
|
end
|
156
156
|
|
157
|
+
# Gets all information about a user based on the given ID.
|
158
|
+
#
|
159
|
+
# @param [Int] id The ID of the user record to retrieve.
|
160
|
+
def user(id)
|
161
|
+
target = "#{self.base_url}/user/#{id.to_s}/"
|
162
|
+
self.class.get(target, {basic_auth: self.auth})
|
163
|
+
end
|
164
|
+
|
157
165
|
def parse_action_options(options)
|
158
166
|
included_options = {}
|
159
167
|
acceptable_options = [
|
data/spec/connector_spec.rb
CHANGED
@@ -41,6 +41,28 @@ describe 'Connector' do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
describe '#user' do
|
45
|
+
before do
|
46
|
+
stub_request(:get, 'http://username:password@api.example.com/user/100/')
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'finds a user based on a given ID' do
|
50
|
+
client.user(100)
|
51
|
+
expect(WebMock).to have_requested(:get, 'http://username:password@api.example.com/user/100/')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe '#petition_page' do
|
56
|
+
before do
|
57
|
+
stub_request(:get, 'http://username:password@api.example.com/petitionpage/100/')
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'finds a page based on a given ID' do
|
61
|
+
client.petition_page(100)
|
62
|
+
expect(WebMock).to have_requested(:get, 'http://username:password@api.example.com/petitionpage/100/')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
44
66
|
describe "#create_petition_page" do
|
45
67
|
|
46
68
|
let(:request_body) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionkit_connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Boersma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|