actionkit_connector 0.3.0 → 0.4.0

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: b25d549d3ea61e0a351d0816761597228991f8fa
4
- data.tar.gz: b612b116a374417c53b4bce966da9fe9875b5523
3
+ metadata.gz: b0536a04809c61a01c4c92e70b45e3c2bd52a4fe
4
+ data.tar.gz: 30ee7add2c690f34d8de58dc59875e5057c5596f
5
5
  SHA512:
6
- metadata.gz: 808a3bd13d3b379b3adee3cdbf384cc9041864d2a9d2bd9dea3862777a98772fb518eb9d0eb8237e812fedb2d124fb36dc7718c4ec3ac5277f558b8d9f6f7812
7
- data.tar.gz: 0b58e244b6be5da2a097f6b697c75aade04c87b59789049a4ffb5c93986cb7005bcd570ddee23c4d18a45bdcca163b8373a4d88ee4070459c231edec6abcc03f
6
+ metadata.gz: b87f08e2acf123cc58f1baf4e7e440fbaf69484f5a342284fb391ccc8080e06c82aefd423f43215565cc7ce9085354d9c1405b047058ba36159d5b836363251c
7
+ data.tar.gz: dec39a590b90edb6c6024791b9a7296fc9a75e2dcd01e5ea328f955cdecd7c019e532cbd4000437a3fadcda673873571e490771afb0ffa2fd55588fb5a203343
@@ -1,3 +1,3 @@
1
1
  module ActionkitConnector
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -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 = [
@@ -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.3.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-01-14 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty