checkdin 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Checkdin
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
@@ -0,0 +1,17 @@
1
+ module Checkdin
2
+ module Votes
3
+
4
+ # Get a list of all votes for the authenticating client.
5
+ #
6
+ # @param [Hash] options
7
+ # @option options Integer :user_id - Only return votes for this user.
8
+ # @option options Integer :limit - The maximum number of records to return.
9
+
10
+ def votes(options={})
11
+ response = connection.get do |req|
12
+ req.url "votes", options
13
+ end
14
+ return_error_or_body(response)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,48 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://app.checkd.in:443/api/v1/activities/18881/vote?client_id=123456&client_secret=7890
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.1
12
+ content-length:
13
+ - "0"
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Mon, 09 Apr 2012 10:38:50 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"78c7474e01ca50b8cfc238ad7974fed1\""
37
+ cache-control:
38
+ - max-age=0, private, must-revalidate
39
+ set-cookie:
40
+ - _checkdin_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJWQ3MmVkYzllYzNhZWVhYmU4ZmQ2YjNlN2IxZjEyMjE2BjsAVA%3D%3D--8c08feb9944b93e628e7740a373d79e5adb6bd73; domain=app.checkd.in; path=/; HttpOnly; secure
41
+ x-runtime:
42
+ - "0.039170"
43
+ x-rack-cache:
44
+ - invalidate, pass
45
+ body: |
46
+ {"activity":{"type":"twitter_status","id":18881,"created_at":"2012-02-21T16:08:55-06:00","acted_on":{"type":"twitter_status","tweet_fk":172080368760000512,"status":"Check out what I purchased at #mynordstrom http://t.co/DKUXa41E","photo_url":"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg","photo_thumbnail_url":"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg:thumb"},"user":{"id":36,"username":"demomattloadtest","avatar_url":null,"href":"https://app.checkd.in/api/v1/activities.json?user_id=36"},"vote_count":6}}
47
+
48
+ http_version: "1.1"
@@ -0,0 +1,48 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://app.checkd.in:443/api/v1/activities/18881/vote?client_id=123456&client_secret=7890&user_id=36
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.1
12
+ content-length:
13
+ - "0"
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Mon, 09 Apr 2012 10:42:37 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"22ee544aa801964a479d745eb9bdba07\""
37
+ cache-control:
38
+ - max-age=0, private, must-revalidate
39
+ set-cookie:
40
+ - _checkdin_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTYyNjY0NTlhMThkZmFjNTJlMzcwMTA4NTc0OThiMWZlBjsAVA%3D%3D--c70adeb132862f669fc85fc8e5e643ea2b811b57; domain=app.checkd.in; path=/; HttpOnly; secure
41
+ x-runtime:
42
+ - "0.037890"
43
+ x-rack-cache:
44
+ - invalidate, pass
45
+ body: |
46
+ {"activity":{"type":"twitter_status","id":18881,"created_at":"2012-02-21T16:08:55-06:00","acted_on":{"type":"twitter_status","tweet_fk":172080368760000512,"status":"Check out what I purchased at #mynordstrom http://t.co/DKUXa41E","photo_url":"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg","photo_thumbnail_url":"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg:thumb"},"user":{"id":36,"username":"demomattloadtest","avatar_url":null,"href":"https://app.checkd.in/api/v1/activities.json?user_id=36"},"vote_count":7}}
47
+
48
+ http_version: "1.1"
@@ -0,0 +1,44 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://app.checkd.in:443/api/v1/promotions/54/votes_leaderboard?client_id=123456&client_secret=7890&limit
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.1
12
+ accept-encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Mon, 09 Apr 2012 11:00:42 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"5e76880528d8f34bcf0b8faae48936d6\""
37
+ cache-control:
38
+ - must-revalidate, private, max-age=0
39
+ x-runtime:
40
+ - "0.123999"
41
+ x-rack-cache:
42
+ - miss
43
+ body: "{\"promotion\":{\"title\":\"A voting promotion!\",\"description\":\"You iz winning.\",\"terms\":\"\",\"above_21_only\":false,\"ends_at\":\"2012-05-08T05:42:00-05:00\",\"href\":\"https://app.checkd.in/api/v1/promotions/54.json\",\"type\":\"promotion_photo\",\"twitter_hashtag\":\"#mynordstrom\",\"participant_status_message\":null,\"reward\":{\"private_delivery_description\":\"You won\",\"public_delivery_description\":\"\",\"single_delivery\":false,\"type\":\"point_reward\",\"reward_points\":100},\"trigger_schedule\":{\"rewarding\":\"many\",\"winner_picked\":\"activity_interval\",\"interval\":1,\"human_readable\":\"Rewarded every time the same user performs a relevant action.\"},\"votes_leaderboard\":{\"total_pages\":1,\"activities\":[{\"activity\":{\"type\":\"twitter_status\",\"id\":18881,\"created_at\":\"2012-02-21T16:08:55-06:00\",\"acted_on\":{\"type\":\"twitter_status\",\"tweet_fk\":172080368760000512,\"status\":\"Check out what I purchased at #mynordstrom http://t.co/DKUXa41E\",\"photo_url\":\"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg\",\"photo_thumbnail_url\":\"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg:thumb\"},\"user\":{\"id\":36,\"username\":\"demomattloadtest\",\"avatar_url\":null,\"href\":\"https://app.checkd.in/api/v1/activities.json?user_id=36\"},\"href\":\"https://app.checkd.in/api/v1/activities/18881.json\",\"vote_count\":7}},{\"activity\":{\"type\":\"twitter_status\",\"id\":18882,\"created_at\":\"2012-02-22T09:08:47-06:00\",\"acted_on\":{\"type\":\"twitter_status\",\"tweet_fk\":172337035716198401,\"status\":\"Check out #mynordstrom http://t.co/bvqmQX7B\",\"photo_url\":\"https://p.twimg.com/AmRDnvPCAAIYYMY.jpg\",\"photo_thumbnail_url\":\"https://p.twimg.com/AmRDnvPCAAIYYMY.jpg:thumb\"},\"user\":{\"id\":36,\"username\":\"demomattloadtest\",\"avatar_url\":null,\"href\":\"https://app.checkd.in/api/v1/activities.json?user_id=36\"},\"href\":\"https://app.checkd.in/api/v1/activities/18882.json\",\"vote_count\":0}},{\"activity\":{\"type\":\"twitter_status\",\"id\":18883,\"created_at\":\"2012-02-22T09:55:58-06:00\",\"acted_on\":{\"type\":\"twitter_status\",\"tweet_fk\":172348911032336384,\"status\":\"Check out this cool purchase #mynordstrom http://t.co/JKXzWuVu\",\"photo_url\":\"https://p.twimg.com/AmROa-PCAAAcMe1.jpg\",\"photo_thumbnail_url\":\"https://p.twimg.com/AmROa-PCAAAcMe1.jpg:thumb\"},\"user\":{\"id\":36,\"username\":\"demomattloadtest\",\"avatar_url\":null,\"href\":\"https://app.checkd.in/api/v1/activities.json?user_id=36\"},\"href\":\"https://app.checkd.in/api/v1/activities/18883.json\",\"vote_count\":0}}]},\"campaign\":{\"name\":\"Nordstrom Rewards\",\"description\":\"Earn discounts and other great rewards for joining Nordstrom Fashion Rewards!\",\"start_date\":\"2011-12-14\",\"end_date\":\"2012-06-01\",\"href\":\"https://app.checkd.in/api/v1/campaigns/11.json\"}}}"
44
+ http_version: "1.1"
@@ -0,0 +1,44 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://app.checkd.in:443/api/v1/promotions/54/votes_leaderboard?client_id=123456&client_secret=7890&limit=1
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.1
12
+ accept-encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Mon, 09 Apr 2012 11:02:11 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"616689e5a2d0af0ef532965e0f6aad51\""
37
+ cache-control:
38
+ - must-revalidate, private, max-age=0
39
+ x-runtime:
40
+ - "0.128383"
41
+ x-rack-cache:
42
+ - miss
43
+ body: "{\"promotion\":{\"title\":\"A voting promotion!\",\"description\":\"You iz winning\",\"terms\":\"\",\"above_21_only\":false,\"ends_at\":\"2012-05-08T05:42:00-05:00\",\"href\":\"https://app.checkd.in/api/v1/promotions/54.json\",\"type\":\"promotion_photo\",\"twitter_hashtag\":\"#mynordstrom\",\"participant_status_message\":null,\"reward\":{\"private_delivery_description\":\"\",\"public_delivery_description\":\"\",\"single_delivery\":false,\"type\":\"point_reward\",\"reward_points\":100},\"trigger_schedule\":{\"rewarding\":\"many\",\"winner_picked\":\"activity_interval\",\"interval\":1,\"human_readable\":\"Rewarded every time the same user performs a relevant action.\"},\"votes_leaderboard\":{\"total_pages\":3,\"activities\":[{\"activity\":{\"type\":\"twitter_status\",\"id\":18881,\"created_at\":\"2012-02-21T16:08:55-06:00\",\"acted_on\":{\"type\":\"twitter_status\",\"tweet_fk\":172080368760000512,\"status\":\"Check out what I purchased at #mynordstrom http://t.co/DKUXa41E\",\"photo_url\":\"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg\",\"photo_thumbnail_url\":\"https://p.twimg.com/AmNaLwUCEAIt1v3.jpg:thumb\"},\"user\":{\"id\":36,\"username\":\"demomattloadtest\",\"avatar_url\":null,\"href\":\"https://app.checkd.in/api/v1/activities.json?user_id=36\"},\"href\":\"https://app.checkd.in/api/v1/activities/18881.json\",\"vote_count\":7}}]},\"campaign\":{\"name\":\"Nordstrom Rewards\",\"description\":\"Earn discounts and other great rewards for joining Nordstrom Fashion Rewards!\",\"start_date\":\"2011-12-14\",\"end_date\":\"2012-06-01\",\"href\":\"https://app.checkd.in/api/v1/campaigns/11.json\"}}}"
44
+ http_version: "1.1"
@@ -0,0 +1,44 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://app.checkd.in:443/api/v1/votes?client_id=123456&client_secret=7890&user_id=36
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.2
12
+ accept-encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Tue, 17 Apr 2012 15:57:37 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"e5be3080253b60063d29411e65400701\""
37
+ cache-control:
38
+ - must-revalidate, private, max-age=0
39
+ x-runtime:
40
+ - "0.101455"
41
+ x-rack-cache:
42
+ - miss
43
+ body: "{\"total_pages\":1,\"votes\":[{\"vote\":{\"created_at\":\"2012-04-09T05:42:37-05:00\",\"user\":{\"id\":36,\"href\":\"https://staging.checkd.in/api/v1/users/36.json\"},\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:52:18-05:00\",\"user\":{\"id\":36,\"href\":\"https://staging.checkd.in/api/v1/users/36.json\"},\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:52:12-05:00\",\"user\":{\"id\":36,\"href\":\"https://staging.checkd.in/api/v1/users/36.json\"},\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}}]}"
44
+ http_version: "1.1"
@@ -0,0 +1,44 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://app.checkd.in:443/api/v1/votes?client_id=123456&client_secret=7890
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.2
12
+ accept-encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Tue, 17 Apr 2012 15:57:36 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"0b1ec43ded6cc7875c4c284e7e112874\""
37
+ cache-control:
38
+ - must-revalidate, private, max-age=0
39
+ x-runtime:
40
+ - "0.047213"
41
+ x-rack-cache:
42
+ - miss
43
+ body: "{\"total_pages\":1,\"votes\":[{\"vote\":{\"created_at\":\"2012-04-09T05:42:37-05:00\",\"user\":{\"id\":36,\"href\":\"https://staging.checkd.in/api/v1/users/36.json\"},\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-09T05:38:50-05:00\",\"user\":null,\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:52:18-05:00\",\"user\":{\"id\":36,\"href\":\"https://staging.checkd.in/api/v1/users/36.json\"},\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:52:12-05:00\",\"user\":{\"id\":36,\"href\":\"https://staging.checkd.in/api/v1/users/36.json\"},\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:51:53-05:00\",\"user\":null,\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:30:05-05:00\",\"user\":null,\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}},{\"vote\":{\"created_at\":\"2012-04-08T06:26:47-05:00\",\"user\":null,\"activity\":{\"id\":18881,\"href\":\"https://staging.checkd.in/api/v1/activities/18881.json\"}}}]}"
44
+ http_version: "1.1"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: checkdin
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.3
5
+ version: 0.2.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt Mueller
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: 1.0.0
93
+ version: "1.0"
94
94
  type: :development
95
95
  version_requirements: *id007
96
96
  - !ruby/object:Gem::Dependency
@@ -165,6 +165,7 @@ files:
165
165
  - lib/checkdin/users.rb
166
166
  - lib/checkdin/user_bridge.rb
167
167
  - lib/checkdin/version.rb
168
+ - lib/checkdin/votes.rb
168
169
  - lib/checkdin/won_rewards.rb
169
170
  - spec/checkdin/activities_spec.rb
170
171
  - spec/checkdin/campaigns_spec.rb
@@ -177,14 +178,20 @@ files:
177
178
  - spec/checkdin/won_rewards_spec.rb
178
179
  - spec/fixtures/vcr_cassettes/Checkdin_Activities/viewing_a_list_of_activities.yml
179
180
  - spec/fixtures/vcr_cassettes/Checkdin_Activities/viewing_a_single_activity.yml
181
+ - spec/fixtures/vcr_cassettes/Checkdin_Activities/voting_for_an_activity.yml
182
+ - spec/fixtures/vcr_cassettes/Checkdin_Activities/voting_for_an_activity/passing_an_email.yml
180
183
  - spec/fixtures/vcr_cassettes/Checkdin_Campaigns/viewing_a_list_of_campaigns.yml
181
184
  - spec/fixtures/vcr_cassettes/Checkdin_Campaigns/viewing_a_single_campaign.yml
182
185
  - spec/fixtures/vcr_cassettes/Checkdin_CustomActivities.yml
183
186
  - spec/fixtures/vcr_cassettes/Checkdin_Leaderboard/viewing_a_leaderboard_for_a_campaign.yml
184
187
  - spec/fixtures/vcr_cassettes/Checkdin_Promotions/viewing_a_list_of_promotions.yml
185
188
  - spec/fixtures/vcr_cassettes/Checkdin_Promotions/viewing_a_single_promotion.yml
189
+ - spec/fixtures/vcr_cassettes/Checkdin_Promotions/viewing_the_votes_leaderboard_for_a_promotion.yml
190
+ - spec/fixtures/vcr_cassettes/Checkdin_Promotions/viewing_the_votes_leaderboard_for_a_promotion/limiting_the_number_of_records_returned.yml
186
191
  - spec/fixtures/vcr_cassettes/Checkdin_Users/viewing_a_list_of_users.yml
187
192
  - spec/fixtures/vcr_cassettes/Checkdin_Users/viewing_a_single_user.yml
193
+ - spec/fixtures/vcr_cassettes/Checkdin_Votes/filtering_by_a_single_user.yml
194
+ - spec/fixtures/vcr_cassettes/Checkdin_Votes/viewing_a_list_of_activities.yml
188
195
  - spec/fixtures/vcr_cassettes/Checkdin_WonRewards/viewing_a_list_of_won_rewards.yml
189
196
  - spec/fixtures/vcr_cassettes/Checkdin_WonRewards/viewing_a_single_won_reward.yml
190
197
  - spec/spec_helper.rb