access 2.0.27 → 2.0.28

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: 452511cfe0a62586a0e2f2e2ff59da7a6f8be192
4
- data.tar.gz: f51ae12311118413980fc6be52c6e9e4e49422c7
3
+ metadata.gz: a8c696583e152204ca41b7fee8baeae782615c0e
4
+ data.tar.gz: cd514d0baf304cccee1f67a83fe3c7021480c485
5
5
  SHA512:
6
- metadata.gz: 8263e71a4b387273166916b37b090614f5576b05dd99d7225dfe4e3c7a5430ee8febd4af141cd171db558bd4426d22ca8d5c97a67eeae17ef2717b61918e00f8
7
- data.tar.gz: 0421dbef6dfd573b0a23734eee63f8fabe98f2df31deb16ed6105e9e15d285228943febe35734ec7a867c24c16081eb0fc9453b0783f15e560eb27ee5e47b9e5
6
+ metadata.gz: 410245f7bb9cc93d0641314d1ae693be78eb9dd50270858f78b84ab57edb12180be797b9ae63645be3cf3f8cb19089a0ecab722955388e1bee37e97bfa458739
7
+ data.tar.gz: 881354b22ed913f40c4697b7624f05b5fce40b130545f124507e091213956142a78fa9f7504227f3fb45f33876dae95fcd97e4e620bef5ac294cfbc7d016473a
@@ -15,6 +15,8 @@ module Access
15
15
  attr_reader :key, :campaign_name, :campaign_description, :start_date, :end_date, :campaign_ranking, :spot_list, :channel_list
16
16
  #spot show page
17
17
  attr_reader :spot_name, :spot_text, :spot_ranking, :spot_redirect_url, :spot_redirect_type, :spot_image_url, :offer_resource
18
+ #channel show page
19
+ attr_reader :channel_name, :channel_type, :channel_identifier, :channel_description
18
20
 
19
21
  def initialize(response)
20
22
  @response = response # Setting this temporarily so i can have a working member reg call, since it doesn't follow the resource [] best practices
@@ -149,7 +151,7 @@ module Access
149
151
 
150
152
  class ChannelResponse < Response
151
153
  def process_data
152
- @channels = Access::Channel.process_batch(@channels)
154
+ @channels = Access::Channel.process_batch(@channels) if @channels
153
155
  end
154
156
  end
155
157
 
@@ -1,4 +1,4 @@
1
1
  module Access
2
- VERSION = "2.0.27"
2
+ VERSION = "2.0.28"
3
3
  end
4
4
 
@@ -32,7 +32,7 @@ class CampaignTest < Minitest::Test
32
32
  campaigns_response = Access::Campaign.find(@first_campaign.key, member_key: 'API_RUBY_GEM_TEST', channel_key: 20889900, api_environment: 'stage')
33
33
  assert campaigns_response.success
34
34
  assert_kind_of Access::CampaignResponse, campaigns_response
35
- base_attributes = [:campaign_name, :campaign_description, :start_date, :end_date, :campaign_ranking, :spot_list, :channel_list, :links]
35
+ base_attributes = [:key, :campaign_name, :campaign_description, :start_date, :end_date, :campaign_ranking, :spot_list, :channel_list, :links]
36
36
  base_attributes.each do |att|
37
37
  assert campaigns_response.respond_to?(att), "#{att} not found"
38
38
  end
@@ -0,0 +1,38 @@
1
+ require './test/test_helper'
2
+
3
+ class ChannelTest < Minitest::Test
4
+
5
+ def get_first_channel
6
+ VCR.use_cassette('channel search') do
7
+ @first_channel = Access::Channel.search(member_key: 'API_RUBY_GEM_TEST', api_environment: 'stage').channels.first
8
+ end
9
+ end
10
+
11
+ def test_channels_search
12
+ VCR.use_cassette('channel search') do
13
+ channels_response = Access::Channel.search(member_key: 'API_RUBY_GEM_TEST', api_environment: 'stage')
14
+ assert channels_response.success
15
+ first_channel = channels_response.channels.first
16
+ assert_kind_of Access::ChannelResponse, channels_response
17
+ assert_kind_of Array, channels_response.channels
18
+ assert_kind_of Access::Channel, first_channel
19
+ assert_kind_of Access::Link, first_channel.links.first
20
+ end
21
+ end
22
+
23
+ def test_channels_find
24
+ get_first_channel
25
+ VCR.use_cassette('channel find') do
26
+ channels_response = Access::Channel.find(@first_channel.key, member_key: 'API_RUBY_GEM_TEST', api_environment: 'stage')
27
+ assert channels_response.success
28
+ assert_kind_of Access::ChannelResponse, channels_response
29
+ base_attributes = [:key, :channel_name, :channel_type, :channel_identifier, :channel_description, :links]
30
+ base_attributes.each do |att|
31
+ assert channels_response.respond_to?(att), "#{att} not found"
32
+ end
33
+ assert_kind_of Array, channels_response.links
34
+ assert_kind_of Access::Link, channels_response.links.first
35
+ end
36
+ end
37
+
38
+ end
@@ -40,7 +40,7 @@ class SpotTest < Minitest::Test
40
40
  spots_response = Access::Spot.find(@first_spot.key, member_key: 'API_RUBY_GEM_TEST', api_environment: 'stage')
41
41
  assert spots_response.success
42
42
  assert_kind_of Access::SpotResponse, spots_response
43
- base_attributes = [:spot_name, :spot_text, :start_date, :end_date, :spot_ranking, :spot_redirect_url, :spot_redirect_type, :spot_image_url, :links]
43
+ base_attributes = [:key, :spot_name, :spot_text, :start_date, :end_date, :spot_ranking, :spot_redirect_url, :spot_redirect_type, :spot_image_url, :links]
44
44
  base_attributes.each do |att|
45
45
  assert spots_response.respond_to?(att), "#{att} not found"
46
46
  end
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://campaign-stage.adcrws.com/v1/channels/20888894?member_key=API_RUBY_GEM_TEST
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Access-Token:
11
+ - ACCESS_TOKEN
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ X-Xss-Protection:
26
+ - 1; mode=block
27
+ Cache-Control:
28
+ - no-cache, no-store, max-age=0, must-revalidate
29
+ Pragma:
30
+ - no-cache
31
+ Expires:
32
+ - '0'
33
+ X-Frame-Options:
34
+ - DENY
35
+ Access-Control-Allow-Origin:
36
+ - "*"
37
+ Access-Control-Allow-Methods:
38
+ - GET
39
+ Access-Control-Max-Age:
40
+ - '3600'
41
+ Access-Control-Allow-Headers:
42
+ - x-requested-with
43
+ Content-Type:
44
+ - application/json;charset=UTF-8
45
+ Transfer-Encoding:
46
+ - chunked
47
+ Date:
48
+ - Fri, 13 Nov 2015 22:19:33 GMT
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"key":20888894,"channel_name":"Web Site","channel_type":"WEBSITE","channel_identifier":"0001","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20888894"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20888894"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20888894"}]}'
52
+ http_version:
53
+ recorded_at: Fri, 13 Nov 2015 22:21:11 GMT
54
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://campaign-stage.adcrws.com/v1/channels?member_key=API_RUBY_GEM_TEST
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Access-Token:
11
+ - ACCESS_TOKEN
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ X-Xss-Protection:
26
+ - 1; mode=block
27
+ Cache-Control:
28
+ - no-cache, no-store, max-age=0, must-revalidate
29
+ Pragma:
30
+ - no-cache
31
+ Expires:
32
+ - '0'
33
+ X-Frame-Options:
34
+ - DENY
35
+ Access-Control-Allow-Origin:
36
+ - "*"
37
+ Access-Control-Allow-Methods:
38
+ - GET
39
+ Access-Control-Max-Age:
40
+ - '3600'
41
+ Access-Control-Allow-Headers:
42
+ - x-requested-with
43
+ Content-Type:
44
+ - application/json;charset=UTF-8
45
+ Transfer-Encoding:
46
+ - chunked
47
+ Date:
48
+ - Fri, 13 Nov 2015 22:19:32 GMT
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"channels":[{"key":20888894,"channel_name":"Web Site","channel_type":"WEBSITE","channel_identifier":"0001","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20888894"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20888894"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20888894"}]},{"key":20888895,"channel_name":"EMail","channel_type":"EMAIL","channel_identifier":"0002","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20888895"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20888895"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20888895"}]},{"key":20888896,"channel_name":"Paper
52
+ Directory","channel_type":"PAPER_DIRECTORY","channel_identifier":"0003","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20888896"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20888896"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20888896"}]},{"key":20888897,"channel_name":"Paper
53
+ Mailer","channel_type":"PAPER_MAILER","channel_identifier":"0004","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20888897"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20888897"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20888897"}]},{"key":20888898,"channel_name":"Mobile
54
+ Application","channel_type":"MOBILE","channel_identifier":"0005","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20888898"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20888898"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20888898"}]},{"key":20889898,"channel_name":"Awp
55
+ Featured Deal","channel_type":"AWP_FEATURED_DEAL","channel_identifier":"0006","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889898"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889898"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889898"}]},{"key":20889899,"channel_name":"Email
56
+ Featured Deal","channel_type":"EMAIL_FEATURED_DEAL","channel_identifier":"0007","channel_description":null,"links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889899"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889899"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889899"}]},{"key":20889900,"channel_name":"Featured
57
+ Brands","channel_type":"AWP_FEATURED_BRANDS","channel_identifier":"0008","channel_description":"AWP
58
+ Featured Brands Channel","links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889900"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889900"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889900"}]},{"key":20889901,"channel_name":"Selected
59
+ Brands","channel_type":"AWP_SELECTED_BRANDS","channel_identifier":"0009","channel_description":"AWP
60
+ Selected Brands Channel","links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889901"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889901"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889901"}]},{"key":20889902,"channel_name":"Home
61
+ Page Banner","channel_type":"HOME_PAGE_BANNER","channel_identifier":"0010","channel_description":"Appears
62
+ on the home page of AWP with larger real estate for ad campaigns","links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889902"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889902"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889902"}]},{"key":20889903,"channel_name":"ACS
63
+ Group 1","channel_type":"ACS_GROUP_1","channel_identifier":"0011","channel_description":"Appears
64
+ on the first tab on the landing page of All City Savings Application","links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889903"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889903"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889903"}]},{"key":20889904,"channel_name":"ACS
65
+ Group 2","channel_type":"ACS_GROUP_2","channel_identifier":"0012","channel_description":"Appears
66
+ on the second tab on the landing page of All City Savings Application","links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889904"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889904"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889904"}]},{"key":20889905,"channel_name":"ACS
67
+ Group 3","channel_type":"ACS_GROUP_3","channel_identifier":"0013","channel_description":"Appears
68
+ on the third tab on the landing page of All City Savings Application","links":[{"rel":"self","href":"http://campaign-stage.adcrws.com/v1/channels/20889905"},{"rel":"campaigns","href":"http://campaign-stage.adcrws.com/v1/campaigns?channel_key=20889905"},{"rel":"spots","href":"http://campaign-stage.adcrws.com/v1/spots/channel/20889905"}]}]}'
69
+ http_version:
70
+ recorded_at: Fri, 13 Nov 2015 22:21:09 GMT
71
+ recorded_with: VCR 2.9.3
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: 2.0.27
4
+ version: 2.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
@@ -248,6 +248,7 @@ files:
248
248
  - test/access/autocomplete_test.rb
249
249
  - test/access/campaign_test.rb
250
250
  - test/access/category_test.rb
251
+ - test/access/channel_test.rb
251
252
  - test/access/city_savings_test.rb
252
253
  - test/access/favorite_test.rb
253
254
  - test/access/filter_test.rb
@@ -275,6 +276,8 @@ files:
275
276
  - test/vcr/cassettes/category_find.yml
276
277
  - test/vcr/cassettes/category_search.yml
277
278
  - test/vcr/cassettes/category_search_fail_member_key.yml
279
+ - test/vcr/cassettes/channel_find.yml
280
+ - test/vcr/cassettes/channel_search.yml
278
281
  - test/vcr/cassettes/favorite_create_generic_with_offer.yml
279
282
  - test/vcr/cassettes/favorite_create_location.yml
280
283
  - test/vcr/cassettes/favorite_create_offer.yml
@@ -367,6 +370,7 @@ test_files:
367
370
  - test/access/autocomplete_test.rb
368
371
  - test/access/campaign_test.rb
369
372
  - test/access/category_test.rb
373
+ - test/access/channel_test.rb
370
374
  - test/access/city_savings_test.rb
371
375
  - test/access/favorite_test.rb
372
376
  - test/access/filter_test.rb
@@ -394,6 +398,8 @@ test_files:
394
398
  - test/vcr/cassettes/category_find.yml
395
399
  - test/vcr/cassettes/category_search.yml
396
400
  - test/vcr/cassettes/category_search_fail_member_key.yml
401
+ - test/vcr/cassettes/channel_find.yml
402
+ - test/vcr/cassettes/channel_search.yml
397
403
  - test/vcr/cassettes/favorite_create_generic_with_offer.yml
398
404
  - test/vcr/cassettes/favorite_create_location.yml
399
405
  - test/vcr/cassettes/favorite_create_offer.yml