access 1.1.7 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.gitignore +2 -0
- data/.travis.yml +12 -0
- data/Guardfile +7 -0
- data/README.md +159 -23
- data/Rakefile +13 -0
- data/access.gemspec +6 -1
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/access.rb +21 -10
- data/lib/access/api.rb +188 -64
- data/lib/access/autocomplete.rb +11 -0
- data/lib/access/campaign.rb +24 -0
- data/lib/access/category.rb +16 -2
- data/lib/access/channel.rb +24 -0
- data/lib/access/city_savings.rb +16 -0
- data/lib/access/config.rb +8 -7
- data/lib/access/error.rb +8 -2
- data/lib/access/filter.rb +30 -2
- data/lib/access/info.rb +13 -0
- data/lib/access/link.rb +17 -0
- data/lib/access/location.rb +17 -2
- data/lib/access/member.rb +11 -0
- data/lib/access/oauth_application.rb +31 -0
- data/lib/access/offer.rb +24 -20
- data/lib/access/redeem.rb +11 -4
- data/lib/access/report.rb +10 -0
- data/lib/access/request.rb +25 -20
- data/lib/access/response.rb +127 -0
- data/lib/access/spot.rb +28 -0
- data/lib/access/store.rb +16 -2
- data/lib/access/token.rb +18 -0
- data/lib/access/verify.rb +11 -2
- data/lib/access/version.rb +1 -1
- data/test/access/autocomplete_test.rb +53 -0
- data/test/access/category_test.rb +64 -0
- data/test/access/city_savings_test.rb +5 -0
- data/test/access/filter_test.rb +40 -0
- data/test/access/location_test.rb +59 -0
- data/test/access/member_test.rb +5 -0
- data/test/access/oauth_application_test.rb +91 -0
- data/test/access/offer_test.rb +71 -0
- data/test/access/redeem_test.rb +38 -0
- data/test/access/report_test.rb +36 -0
- data/test/access/store_test.rb +65 -0
- data/test/access/token_test.rb +35 -0
- data/test/access/verify_test.rb +29 -0
- data/test/access/version_test.rb +9 -0
- data/test/fixtures/autocomplete_search.yml +207 -0
- data/test/fixtures/autocomplete_search_categories.yml +181 -0
- data/test/fixtures/autocomplete_search_locations.yml +173 -0
- data/test/fixtures/autocomplete_search_offers.yml +181 -0
- data/test/fixtures/autocomplete_search_stores.yml +185 -0
- data/test/fixtures/category_find.yml +303 -0
- data/test/fixtures/category_search.yml +683 -0
- data/test/fixtures/category_search_fail_member_key.yml +102 -0
- data/test/fixtures/filter_find.yml +70 -0
- data/test/fixtures/filter_search.yml +195 -0
- data/test/fixtures/location_find.yml +923 -0
- data/test/fixtures/location_search.yml +378 -0
- data/test/fixtures/location_search_fail_member_key.yml +367 -0
- data/test/fixtures/national_stores.yml +4135 -0
- data/test/fixtures/oauth_application_find.yml +163 -0
- data/test/fixtures/oauth_application_search.yml +134 -0
- data/test/fixtures/oauth_application_search_fail_member_key.yml +268 -0
- data/test/fixtures/oauth_application_token_find.yml +249 -0
- data/test/fixtures/oauth_application_token_search.yml +98 -0
- data/test/fixtures/offer_find.yml +683 -0
- data/test/fixtures/offer_search.yml +329 -0
- data/test/fixtures/offer_search_fail_member_key.yml +102 -0
- data/test/fixtures/redeem_offer_no_redeem_type.yml +423 -0
- data/test/fixtures/store_find.yml +333 -0
- data/test/fixtures/store_search.yml +227 -0
- data/test/fixtures/store_search_fail_member_key.yml +102 -0
- data/test/fixtures/subcategory_find.yml +283 -0
- data/test/fixtures/token_find.yml +245 -0
- data/test/fixtures/token_search.yml +301 -0
- data/test/fixtures/verify_filter.yml +290 -0
- data/test/fixtures/verify_token.yml +78 -0
- data/test/test_helper.rb +15 -0
- metadata +183 -11
- data/test/offers/offer_test.rb +0 -5
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://token-demo.adcrws.com/v1/verify
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Access-Token:
|
11
|
+
- token_without_limit
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Access-Control-Allow-Headers:
|
22
|
+
- Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Token
|
23
|
+
Access-Control-Allow-Methods:
|
24
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
25
|
+
Access-Control-Max-Age:
|
26
|
+
- '1728000'
|
27
|
+
Access-Control-Request-Method:
|
28
|
+
- GET
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=0, private, must-revalidate
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
Date:
|
34
|
+
- Wed, 12 Aug 2015 17:46:35 GMT
|
35
|
+
Etag:
|
36
|
+
- '"2beb47a75a9f1995452e6b07484c545c"'
|
37
|
+
Server:
|
38
|
+
- nginx/1.6.2
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=31536000
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Frame-Options:
|
44
|
+
- SAMEORIGIN
|
45
|
+
X-Request-Id:
|
46
|
+
- fef04a99-15ff-47c7-a8b0-0a03a163a3d4
|
47
|
+
X-Runtime:
|
48
|
+
- '0.007711'
|
49
|
+
X-Xss-Protection:
|
50
|
+
- 1; mode=block
|
51
|
+
Content-Length:
|
52
|
+
- '479'
|
53
|
+
Connection:
|
54
|
+
- keep-alive
|
55
|
+
body:
|
56
|
+
encoding: UTF-8
|
57
|
+
string: |-
|
58
|
+
{
|
59
|
+
"oauth_access_token": {
|
60
|
+
"token": "token_without_limit",
|
61
|
+
"domains": [
|
62
|
+
|
63
|
+
],
|
64
|
+
"created_at": "2015-07-13T15:43:35.134Z",
|
65
|
+
"revoked_at": null,
|
66
|
+
"expires_in": null,
|
67
|
+
"application_name": "token_without_limit",
|
68
|
+
"organization_name": "Access Development",
|
69
|
+
"organization_customer_identifier": "160",
|
70
|
+
"program_name": "Garden Club",
|
71
|
+
"program_customer_identifier": "2",
|
72
|
+
"program_end_dts": "2029-06-09",
|
73
|
+
"program_start_dts": "2012-04-12"
|
74
|
+
}
|
75
|
+
}
|
76
|
+
http_version:
|
77
|
+
recorded_at: Wed, 12 Aug 2015 17:46:35 GMT
|
78
|
+
recorded_with: VCR 2.9.3
|
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
+
SimpleCov::Formatter::HTMLFormatter,
|
6
|
+
Coveralls::SimpleCov::Formatter
|
7
|
+
]
|
8
|
+
SimpleCov.start
|
9
|
+
|
1
10
|
require './lib/access'
|
2
11
|
require 'minitest/autorun'
|
12
|
+
require 'minitest/pride'
|
13
|
+
require 'minitest/focus'
|
3
14
|
require 'webmock/minitest'
|
4
15
|
require 'vcr'
|
5
16
|
|
17
|
+
|
6
18
|
VCR.configure do |c|
|
19
|
+
c.default_cassette_options = { record: ENV["RECORD"] ? ENV["RECORD"].to_sym : :all }
|
20
|
+
# , match_requests_on: [:body]
|
7
21
|
c.cassette_library_dir = "test/fixtures"
|
8
22
|
c.hook_into :webmock
|
23
|
+
c.ignore_hosts 'codeclimate.com'
|
9
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: access
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -97,19 +97,75 @@ dependencies:
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
100
|
+
name: guard
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- - "
|
103
|
+
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0
|
106
|
-
type: :
|
105
|
+
version: '0'
|
106
|
+
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- - "
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0
|
112
|
+
version: '0'
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: guard-minitest
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: coveralls
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: simplecov
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
- !ruby/object:Gem::Dependency
|
156
|
+
name: minitest-focus
|
157
|
+
requirement: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
type: :development
|
163
|
+
prerelease: false
|
164
|
+
version_requirements: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
113
169
|
- !ruby/object:Gem::Dependency
|
114
170
|
name: hashie
|
115
171
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,28 +180,54 @@ dependencies:
|
|
124
180
|
- - "~>"
|
125
181
|
- !ruby/object:Gem::Version
|
126
182
|
version: 3.3.1
|
183
|
+
- !ruby/object:Gem::Dependency
|
184
|
+
name: httparty
|
185
|
+
requirement: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - "~>"
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: 0.13.3
|
190
|
+
type: :runtime
|
191
|
+
prerelease: false
|
192
|
+
version_requirements: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - "~>"
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: 0.13.3
|
127
197
|
description: Ruby wrapper for Access API
|
128
198
|
email:
|
129
199
|
- beneggett@gmail.com
|
130
|
-
executables:
|
200
|
+
executables:
|
201
|
+
- console
|
202
|
+
- setup
|
131
203
|
extensions: []
|
132
204
|
extra_rdoc_files: []
|
133
205
|
files:
|
206
|
+
- ".coveralls.yml"
|
134
207
|
- ".gitignore"
|
135
208
|
- ".ruby-gemset"
|
136
209
|
- ".ruby-version"
|
210
|
+
- ".travis.yml"
|
137
211
|
- Gemfile
|
212
|
+
- Guardfile
|
138
213
|
- LICENSE.txt
|
139
214
|
- README.md
|
140
215
|
- Rakefile
|
141
216
|
- access.gemspec
|
217
|
+
- bin/console
|
218
|
+
- bin/setup
|
142
219
|
- lib/access.rb
|
143
220
|
- lib/access/api.rb
|
144
221
|
- lib/access/autocomplete.rb
|
222
|
+
- lib/access/campaign.rb
|
145
223
|
- lib/access/category.rb
|
224
|
+
- lib/access/channel.rb
|
225
|
+
- lib/access/city_savings.rb
|
146
226
|
- lib/access/config.rb
|
147
227
|
- lib/access/error.rb
|
148
228
|
- lib/access/filter.rb
|
229
|
+
- lib/access/info.rb
|
230
|
+
- lib/access/link.rb
|
149
231
|
- lib/access/location.rb
|
150
232
|
- lib/access/member.rb
|
151
233
|
- lib/access/oauth_application.rb
|
@@ -153,11 +235,57 @@ files:
|
|
153
235
|
- lib/access/redeem.rb
|
154
236
|
- lib/access/report.rb
|
155
237
|
- lib/access/request.rb
|
238
|
+
- lib/access/response.rb
|
239
|
+
- lib/access/spot.rb
|
156
240
|
- lib/access/store.rb
|
157
241
|
- lib/access/token.rb
|
158
242
|
- lib/access/verify.rb
|
159
243
|
- lib/access/version.rb
|
160
|
-
- test/
|
244
|
+
- test/access/autocomplete_test.rb
|
245
|
+
- test/access/category_test.rb
|
246
|
+
- test/access/city_savings_test.rb
|
247
|
+
- test/access/filter_test.rb
|
248
|
+
- test/access/location_test.rb
|
249
|
+
- test/access/member_test.rb
|
250
|
+
- test/access/oauth_application_test.rb
|
251
|
+
- test/access/offer_test.rb
|
252
|
+
- test/access/redeem_test.rb
|
253
|
+
- test/access/report_test.rb
|
254
|
+
- test/access/store_test.rb
|
255
|
+
- test/access/token_test.rb
|
256
|
+
- test/access/verify_test.rb
|
257
|
+
- test/access/version_test.rb
|
258
|
+
- test/fixtures/autocomplete_search.yml
|
259
|
+
- test/fixtures/autocomplete_search_categories.yml
|
260
|
+
- test/fixtures/autocomplete_search_locations.yml
|
261
|
+
- test/fixtures/autocomplete_search_offers.yml
|
262
|
+
- test/fixtures/autocomplete_search_stores.yml
|
263
|
+
- test/fixtures/category_find.yml
|
264
|
+
- test/fixtures/category_search.yml
|
265
|
+
- test/fixtures/category_search_fail_member_key.yml
|
266
|
+
- test/fixtures/filter_find.yml
|
267
|
+
- test/fixtures/filter_search.yml
|
268
|
+
- test/fixtures/location_find.yml
|
269
|
+
- test/fixtures/location_search.yml
|
270
|
+
- test/fixtures/location_search_fail_member_key.yml
|
271
|
+
- test/fixtures/national_stores.yml
|
272
|
+
- test/fixtures/oauth_application_find.yml
|
273
|
+
- test/fixtures/oauth_application_search.yml
|
274
|
+
- test/fixtures/oauth_application_search_fail_member_key.yml
|
275
|
+
- test/fixtures/oauth_application_token_find.yml
|
276
|
+
- test/fixtures/oauth_application_token_search.yml
|
277
|
+
- test/fixtures/offer_find.yml
|
278
|
+
- test/fixtures/offer_search.yml
|
279
|
+
- test/fixtures/offer_search_fail_member_key.yml
|
280
|
+
- test/fixtures/redeem_offer_no_redeem_type.yml
|
281
|
+
- test/fixtures/store_find.yml
|
282
|
+
- test/fixtures/store_search.yml
|
283
|
+
- test/fixtures/store_search_fail_member_key.yml
|
284
|
+
- test/fixtures/subcategory_find.yml
|
285
|
+
- test/fixtures/token_find.yml
|
286
|
+
- test/fixtures/token_search.yml
|
287
|
+
- test/fixtures/verify_filter.yml
|
288
|
+
- test/fixtures/verify_token.yml
|
161
289
|
- test/test_helper.rb
|
162
290
|
homepage: http://www.github.com/access-development/api-ruby
|
163
291
|
licenses:
|
@@ -184,5 +312,49 @@ signing_key:
|
|
184
312
|
specification_version: 4
|
185
313
|
summary: Ruby wrapper for Access API
|
186
314
|
test_files:
|
187
|
-
- test/
|
315
|
+
- test/access/autocomplete_test.rb
|
316
|
+
- test/access/category_test.rb
|
317
|
+
- test/access/city_savings_test.rb
|
318
|
+
- test/access/filter_test.rb
|
319
|
+
- test/access/location_test.rb
|
320
|
+
- test/access/member_test.rb
|
321
|
+
- test/access/oauth_application_test.rb
|
322
|
+
- test/access/offer_test.rb
|
323
|
+
- test/access/redeem_test.rb
|
324
|
+
- test/access/report_test.rb
|
325
|
+
- test/access/store_test.rb
|
326
|
+
- test/access/token_test.rb
|
327
|
+
- test/access/verify_test.rb
|
328
|
+
- test/access/version_test.rb
|
329
|
+
- test/fixtures/autocomplete_search.yml
|
330
|
+
- test/fixtures/autocomplete_search_categories.yml
|
331
|
+
- test/fixtures/autocomplete_search_locations.yml
|
332
|
+
- test/fixtures/autocomplete_search_offers.yml
|
333
|
+
- test/fixtures/autocomplete_search_stores.yml
|
334
|
+
- test/fixtures/category_find.yml
|
335
|
+
- test/fixtures/category_search.yml
|
336
|
+
- test/fixtures/category_search_fail_member_key.yml
|
337
|
+
- test/fixtures/filter_find.yml
|
338
|
+
- test/fixtures/filter_search.yml
|
339
|
+
- test/fixtures/location_find.yml
|
340
|
+
- test/fixtures/location_search.yml
|
341
|
+
- test/fixtures/location_search_fail_member_key.yml
|
342
|
+
- test/fixtures/national_stores.yml
|
343
|
+
- test/fixtures/oauth_application_find.yml
|
344
|
+
- test/fixtures/oauth_application_search.yml
|
345
|
+
- test/fixtures/oauth_application_search_fail_member_key.yml
|
346
|
+
- test/fixtures/oauth_application_token_find.yml
|
347
|
+
- test/fixtures/oauth_application_token_search.yml
|
348
|
+
- test/fixtures/offer_find.yml
|
349
|
+
- test/fixtures/offer_search.yml
|
350
|
+
- test/fixtures/offer_search_fail_member_key.yml
|
351
|
+
- test/fixtures/redeem_offer_no_redeem_type.yml
|
352
|
+
- test/fixtures/store_find.yml
|
353
|
+
- test/fixtures/store_search.yml
|
354
|
+
- test/fixtures/store_search_fail_member_key.yml
|
355
|
+
- test/fixtures/subcategory_find.yml
|
356
|
+
- test/fixtures/token_find.yml
|
357
|
+
- test/fixtures/token_search.yml
|
358
|
+
- test/fixtures/verify_filter.yml
|
359
|
+
- test/fixtures/verify_token.yml
|
188
360
|
- test/test_helper.rb
|