citygrid_api 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/.sass-cache/c6f2c767b164f077e5b9fb1f18a7886d7c755211/test.scssc +0 -0
  2. data/README.rdoc +42 -13
  3. data/Rakefile +2 -2
  4. data/VERSION +1 -1
  5. data/citygrid_api.gemspec +23 -12
  6. data/citygrid_api.yml.sample +10 -2
  7. data/citygrid_api.yml.sandbox +46 -0
  8. data/dashboard.rb +1 -1
  9. data/fixtures/vcr_cassettes/AdGroupCriterion_mutate.yml +3 -3
  10. data/fixtures/vcr_cassettes/AdGroupCriterion_search.yml +3 -3
  11. data/fixtures/vcr_cassettes/Adding_a_place.yml +4 -4
  12. data/fixtures/vcr_cassettes/Geo.yml +30 -13
  13. data/fixtures/vcr_cassettes/Getting_an_offer.yml +413 -0
  14. data/fixtures/vcr_cassettes/Getting_an_offer_by_listing_ID.yml +12 -12
  15. data/fixtures/vcr_cassettes/Import_a_cg_account.yml +28 -16
  16. data/fixtures/vcr_cassettes/Initiating_a_Details.yml +14 -30
  17. data/fixtures/vcr_cassettes/Initiating_new_MultiDetails.yml +13 -13
  18. data/fixtures/vcr_cassettes/Mutating_AdGroup_Ads.yml +4 -4
  19. data/fixtures/vcr_cassettes/Report_summary_daily.yml +34 -34
  20. data/fixtures/vcr_cassettes/Report_summary_user_actions.yml +14 -10
  21. data/fixtures/vcr_cassettes/Search_Ad_Group_by_Campaign_Id.yml +3 -3
  22. data/fixtures/vcr_cassettes/Search_Billing_by_Campaign_Id.yml +31 -12
  23. data/fixtures/vcr_cassettes/Search_account_manager_by_Campaign_Id.yml +25 -12
  24. data/fixtures/vcr_cassettes/Searching_AdGroup_Geo.yml +6 -6
  25. data/fixtures/vcr_cassettes/Searching_budgets.yml +31 -12
  26. data/fixtures/vcr_cassettes/Searching_categories_by_listing_id.yml +3 -3
  27. data/fixtures/vcr_cassettes/Searching_categories_by_query.yml +3 -3
  28. data/fixtures/vcr_cassettes/Upload_an_image_Add_a_preview.yml +31 -12
  29. data/fixtures/vcr_cassettes/{Method_of_Payment_mutate.yml → create_a_mop.yml} +24 -12
  30. data/fixtures/vcr_cassettes/create_an_offer.yml +51 -0
  31. data/fixtures/vcr_cassettes/create_campaign.yml +5 -5
  32. data/fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign.yml +61 -0
  33. data/fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign_then_search_.yml +91 -0
  34. data/fixtures/vcr_cassettes/getting_reviews_by_listing_id.yml +91 -0
  35. data/fixtures/vcr_cassettes/log_in_a_session.yml +3 -3
  36. data/fixtures/vcr_cassettes/log_in_a_session_mutate_places.yml +7 -7
  37. data/fixtures/vcr_cassettes/query_account_type_by_id.yml +24 -12
  38. data/fixtures/vcr_cassettes/search_for_an_account_by_id.yml +24 -13
  39. data/fixtures/vcr_cassettes/search_for_an_account_by_name.yml +27 -17
  40. data/fixtures/vcr_cassettes/search_for_call_detail_by_campaign.yml +49 -0
  41. data/fixtures/vcr_cassettes/search_for_mop_by_account_id.yml +65 -0
  42. data/fixtures/vcr_cassettes/searching_for_a_CityGrid_listing.yml +57 -53
  43. data/fixtures/vcr_cassettes/searching_for_a_special_CityGrid_listing.yml +10 -10
  44. data/fixtures/vcr_cassettes/user_log_in_with_raw_API.yml +24 -0
  45. data/fixtures/vcr_cassettes/user_log_in_with_session.yml +24 -0
  46. data/lib/citygrid/api/accounts/account.rb +2 -2
  47. data/lib/citygrid/api/accounts/method_of_payment.rb +2 -2
  48. data/lib/citygrid/api/accounts/user.rb +8 -4
  49. data/lib/citygrid/api/advertising/account_manager.rb +1 -1
  50. data/lib/citygrid/api/advertising/ad_group.rb +2 -2
  51. data/lib/citygrid/api/advertising/ad_group_ad.rb +2 -2
  52. data/lib/citygrid/api/advertising/ad_group_criterion.rb +2 -2
  53. data/lib/citygrid/api/advertising/ad_group_geo.rb +2 -2
  54. data/lib/citygrid/api/advertising/billing.rb +2 -1
  55. data/lib/citygrid/api/advertising/budget.rb +2 -2
  56. data/lib/citygrid/api/advertising/call_detail.rb +2 -2
  57. data/lib/citygrid/api/advertising/campaign.rb +2 -2
  58. data/lib/citygrid/api/advertising/category.rb +2 -2
  59. data/lib/citygrid/api/advertising/geolocation.rb +2 -2
  60. data/lib/citygrid/api/advertising/image.rb +3 -3
  61. data/lib/citygrid/api/advertising/offers.rb +10 -0
  62. data/lib/citygrid/api/advertising/places.rb +2 -2
  63. data/lib/citygrid/api/content/offers.rb +11 -2
  64. data/lib/citygrid/api/content/places.rb +1 -1
  65. data/lib/citygrid/api/content/response.rb +14 -0
  66. data/lib/citygrid/api/content/reviews.rb +5 -2
  67. data/lib/citygrid/api/mutable.rb +13 -0
  68. data/lib/citygrid/api/searchable.rb +4 -6
  69. data/lib/citygrid/api.rb +70 -52
  70. data/lib/citygrid/session.rb +5 -9
  71. data/lib/citygrid.rb +28 -1
  72. data/test/api/accounts/test_account.rb +53 -32
  73. data/test/api/accounts/test_method_of_payment.rb +40 -43
  74. data/test/api/accounts/test_user.rb +16 -0
  75. data/test/api/advertising/test_call_detail.rb +17 -2
  76. data/test/api/advertising/test_offers.rb +33 -0
  77. data/test/api/advertising/test_places.rb +18 -0
  78. data/test/api/content/test_offers.rb +14 -14
  79. data/test/api/content/test_response.rb +51 -0
  80. data/test/api/content/test_reviews.rb +11 -0
  81. data/test/helper.rb +18 -11
  82. metadata +41 -29
  83. data/README +0 -21
  84. data/citygrid_api.yml.backup +0 -35
  85. data/fixtures/vcr_cassettes/Call_Detail_by_campaign.yml +0 -79
  86. data/fixtures/vcr_cassettes/Method_of_Payment_search.yml +0 -59
  87. data/lib/citygrid/api/mutatable.rb +0 -15
@@ -1,10 +1,11 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))
2
2
 
3
- context "Call Detail" do
3
+ context "search for call detail" do
4
+ set :vcr, false
4
5
  context "by campaign" do
5
6
  setup do
6
7
  SessionHelper.sales_coord.call_api CityGrid::API::Advertising::CallDetail,
7
- :campaign,
8
+ :search,
8
9
  :campaignId => 786,
9
10
  :period => 'last30Days'
10
11
  end
@@ -13,7 +14,21 @@ context "Call Detail" do
13
14
  topic.callDetailsResources.length > 0
14
15
  }
15
16
  end
17
+
18
+ context "by adgroup" do
19
+ setup do
20
+ SessionHelper.sales_coord.call_api CityGrid::API::Advertising::CallDetail,
21
+ :search,
22
+ :adGroupId => 7264632,
23
+ :period => 'last30Days'
24
+ end
25
+ should("not be empty"){ !topic.empty? }
26
+ should("have call detail resources"){
27
+ topic.callDetailsResources.length > 0
28
+ }
29
+ end
16
30
 
31
+ # Can't really do this test if can't reliably access the same note again and again
17
32
  # context "note" do
18
33
  # setup do
19
34
  # run_with_rescue do
@@ -0,0 +1,33 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))
2
+
3
+ context "create an offer" do
4
+ setup do
5
+ SessionHelper.gary_test.call_api CityGrid::API::Advertising::Offers,
6
+ :mutate,
7
+ "mutateOperationListResource" => [{
8
+ "operator" => "ADD",
9
+ "operand" => {
10
+ "listingIds" => "41420733",
11
+ "offer" => {
12
+ "accountId" => "3440",
13
+ "name" => "offerTest",
14
+ "text" => "some texts",
15
+ "description" => "some description",
16
+ "offerStatus" => "Active",
17
+ "type" => "Percent_Off",
18
+ "redemptionType" => "Print",
19
+ "termsAndConditions" => "terms and conditions test",
20
+ "redemptionCode" => "22",
21
+ "redemptionURL" => "http://www.fakeurl.com",
22
+ "image" => "http://images.citysearch.net/assets/imgdb/image_ws/2011/10/27/0/BPYAbvWF1.jpeg",
23
+ "startDate" => "20111028",
24
+ "neverExpires" => "true"
25
+ }
26
+ }
27
+ }]
28
+ end
29
+
30
+ should("not be empty") { !topic.empty? }
31
+ should("return code OK") { topic.resources.first.response.code }.equals(200)
32
+ should("return message OK") { topic.resources.first.response.message }.equals("OK")
33
+ end
@@ -31,6 +31,24 @@ context "Adding a place" do
31
31
  should("return message OK") { topic.resources.first.response.message }.equals("OK")
32
32
  end
33
33
 
34
+ context "Getting a place" do
35
+ setup do
36
+ begin
37
+ run_with_rescue do
38
+ SessionHelper.sales_coord.call_api CityGrid::API::Advertising::Places,
39
+ :search,
40
+ :placeId => 628554020
41
+ end
42
+ rescue
43
+ puts "An error occurred while fetching 628554020 details"
44
+ end
45
+ end
46
+
47
+ should "return a single Details object" do
48
+ !topic['placeGetResponseResource'].nil?
49
+ end
50
+ end
51
+
34
52
  #
35
53
  # context "Adding a place" do
36
54
  # setup do
@@ -1,19 +1,19 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))
2
2
 
3
- # context "Getting an offer" do
4
- # setup do
5
- # run_with_rescue do
6
- # response = CityGrid::API::Content::Offers.where(
7
- # :what => "restaurant",
8
- # :where => "98033",
9
- # :format => :json
10
- # )
11
- # response
12
- # end
13
- # end
14
- #
15
- # should("not be empty") { !topic.empty? }
16
- # end
3
+ context "Getting an offer" do
4
+ setup do
5
+ run_with_rescue do
6
+ response = CityGrid::API::Content::Offers.where(
7
+ :what => "restaurant",
8
+ :where => "98033",
9
+ :format => :json
10
+ )
11
+ response
12
+ end
13
+ end
14
+
15
+ should("not be empty") { !topic.empty? }
16
+ end
17
17
 
18
18
  context "Getting an offer by listing ID" do
19
19
  setup do
@@ -0,0 +1,51 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))
2
+
3
+ context "respond to reviews" do
4
+ set :vcr, false
5
+ r = rand(1000)
6
+ context "try to add response" do
7
+ setup do
8
+ SessionHelper.sales_coord.call_api CityGrid::API::Content::Response,
9
+ :mutate,
10
+ "mutateOperationListResource" => [{
11
+ "operator" => "ADD",
12
+ "operand" => {
13
+ "reviewId" => 22772891,
14
+ "text" => "comment text blue"
15
+ }
16
+ }]
17
+ end
18
+ should ("not be empty") { !topic.empty? }
19
+ should ("already have a comment") { topic.reviews[0].responseStatus.message == "The review has already comment from the merchant." }
20
+ end
21
+
22
+ context "edit response" do
23
+ setup do
24
+ SessionHelper.sales_coord.call_api CityGrid::API::Content::Response,
25
+ :mutate,
26
+ "mutateOperationListResource" => [{
27
+ "operator" => "SET",
28
+ "operand" => {
29
+ "reviewId" => 22772891,
30
+ "text" => "comment text #{r}"
31
+ }
32
+ }]
33
+ end
34
+ should ("not be empty") { !topic.empty? }
35
+ should ("be ok") { topic.reviews[0].responseStatus.message == "OK" }
36
+ should ("have correct comment") { topic.reviews[0].userComments == "comment text #{r}"}
37
+ should ("have review text") { !topic.reviews[0].review.text.empty?}
38
+ end
39
+
40
+ context "get response" do
41
+ setup do
42
+ SessionHelper.sales_coord.call_api CityGrid::API::Content::Response,
43
+ :get,
44
+ :reviewId => 22772891
45
+ end
46
+ should ("not be empty") { !topic.empty? }
47
+ should ("be ok") { topic.response.code == 200 }
48
+ should ("have correct comment") { topic.comments[0].text == "comment text #{r}"}
49
+ should ("have review text") { !topic.review.text.empty?}
50
+ end
51
+ end
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))
2
+
3
+ context "getting reviews" do
4
+ context "by listing_id" do
5
+ setup do
6
+ CityGrid::API::Content::Reviews.where :listing_id => 628554020
7
+ end
8
+
9
+ should("not be empty") { !topic.empty? }
10
+ end
11
+ end
data/test/helper.rb CHANGED
@@ -21,17 +21,23 @@ unless defined? IN_DASHBOARD
21
21
  require "publisher_helper"
22
22
 
23
23
  # load default config
24
- CityGrid.load_config File.expand_path(File.join(File.dirname(__FILE__), '..', 'citygrid_api.yml.sample')), "qa"
25
-
24
+ CityGrid.load_config File.expand_path(File.join(File.dirname(__FILE__), '..', 'citygrid_api.yml.sample'))
25
+
26
+ # CityGrid.load_config File.expand_path(File.join(File.dirname(__FILE__), '..', 'citygrid_api.yml.sandbox'))
27
+
26
28
  # Run code with rescue so that exceptions
27
29
  # will be printed, but won't stop test suite
28
30
  def run_with_rescue
29
31
  begin
30
32
  yield
31
- rescue CityGrid::API::InvalidResponseFormat => ex
32
- x = {"description" => ex.description, "server_msg" => ex.server_msg}
33
+ # TODO: fix?
34
+ #rescue CityGrid::API::InvalidResponseFormat => ex
35
+ rescue StandardError => ex
36
+ x = {"description" => ex.message, "server_msg" => "blank"}
37
+ #x = {"description" => ex.description, "server_msg" => ex.server_msg}
33
38
  puts "======= ERROR ======="
34
39
  ap x
40
+ ap ex.backtrace
35
41
  false
36
42
  rescue => ex
37
43
  ap ex
@@ -54,13 +60,14 @@ unless defined? IN_DASHBOARD
54
60
  class Context
55
61
  alias_method :old_run, :run
56
62
  def run reporter
57
- if option(:vcr) != nil && option(:vcr) == false
58
- old_run reporter
59
- else
60
- VCR.use_cassette self.detailed_description[0..70] do
61
- old_run reporter
62
- end
63
- end
63
+ # TODO: does it make any sense for API gem to use vcr?
64
+ #if option(:vcr) != nil && option(:vcr) == false
65
+ old_run reporter
66
+ # else
67
+ # VCR.use_cassette self.detailed_description[0..70] do
68
+ # old_run reporter
69
+ # end
70
+ # end
64
71
  end
65
72
 
66
73
  end
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citygrid_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Elpizo Choi
9
+ - Joseph Chen
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2011-12-30 00:00:00.000000000Z
13
+ date: 2012-02-27 00:00:00.000000000Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: httparty
16
- requirement: &2156985800 !ruby/object:Gem::Requirement
17
+ requirement: &70338570510360 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ~>
@@ -21,10 +22,10 @@ dependencies:
21
22
  version: 0.8.1
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *2156985800
25
+ version_requirements: *70338570510360
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: json
27
- requirement: &2156985320 !ruby/object:Gem::Requirement
28
+ requirement: &70338570509420 !ruby/object:Gem::Requirement
28
29
  none: false
29
30
  requirements:
30
31
  - - =
@@ -32,10 +33,10 @@ dependencies:
32
33
  version: 1.5.3
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *2156985320
36
+ version_requirements: *70338570509420
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: riot
38
- requirement: &2156984840 !ruby/object:Gem::Requirement
39
+ requirement: &70338570508480 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
41
42
  - - ~>
@@ -43,10 +44,10 @@ dependencies:
43
44
  version: 0.12.4
44
45
  type: :runtime
45
46
  prerelease: false
46
- version_requirements: *2156984840
47
+ version_requirements: *70338570508480
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: awesome_print
49
- requirement: &2156984360 !ruby/object:Gem::Requirement
50
+ requirement: &70338570507560 !ruby/object:Gem::Requirement
50
51
  none: false
51
52
  requirements:
52
53
  - - ~>
@@ -54,10 +55,10 @@ dependencies:
54
55
  version: 0.4.0
55
56
  type: :runtime
56
57
  prerelease: false
57
- version_requirements: *2156984360
58
+ version_requirements: *70338570507560
58
59
  - !ruby/object:Gem::Dependency
59
60
  name: bundler
60
- requirement: &2156983880 !ruby/object:Gem::Requirement
61
+ requirement: &70338570506520 !ruby/object:Gem::Requirement
61
62
  none: false
62
63
  requirements:
63
64
  - - ~>
@@ -65,10 +66,10 @@ dependencies:
65
66
  version: 1.0.0
66
67
  type: :development
67
68
  prerelease: false
68
- version_requirements: *2156983880
69
+ version_requirements: *70338570506520
69
70
  - !ruby/object:Gem::Dependency
70
71
  name: jeweler
71
- requirement: &2156983400 !ruby/object:Gem::Requirement
72
+ requirement: &70338570505260 !ruby/object:Gem::Requirement
72
73
  none: false
73
74
  requirements:
74
75
  - - ~>
@@ -76,10 +77,10 @@ dependencies:
76
77
  version: 1.6.2
77
78
  type: :development
78
79
  prerelease: false
79
- version_requirements: *2156983400
80
+ version_requirements: *70338570505260
80
81
  - !ruby/object:Gem::Dependency
81
82
  name: rcov
82
- requirement: &2156982920 !ruby/object:Gem::Requirement
83
+ requirement: &70338570503500 !ruby/object:Gem::Requirement
83
84
  none: false
84
85
  requirements:
85
86
  - - ! '>='
@@ -87,10 +88,10 @@ dependencies:
87
88
  version: '0'
88
89
  type: :development
89
90
  prerelease: false
90
- version_requirements: *2156982920
91
+ version_requirements: *70338570503500
91
92
  - !ruby/object:Gem::Dependency
92
93
  name: vcr
93
- requirement: &2156982440 !ruby/object:Gem::Requirement
94
+ requirement: &70338570501600 !ruby/object:Gem::Requirement
94
95
  none: false
95
96
  requirements:
96
97
  - - ! '>='
@@ -98,10 +99,10 @@ dependencies:
98
99
  version: '0'
99
100
  type: :development
100
101
  prerelease: false
101
- version_requirements: *2156982440
102
+ version_requirements: *70338570501600
102
103
  - !ruby/object:Gem::Dependency
103
104
  name: webmock
104
- requirement: &2156981960 !ruby/object:Gem::Requirement
105
+ requirement: &70338570500360 !ruby/object:Gem::Requirement
105
106
  none: false
106
107
  requirements:
107
108
  - - ! '>='
@@ -109,14 +110,13 @@ dependencies:
109
110
  version: '0'
110
111
  type: :development
111
112
  prerelease: false
112
- version_requirements: *2156981960
113
+ version_requirements: *70338570500360
113
114
  description: Ruby wrapper for CityGrid APIs
114
- email: fu7iin@gmail.com
115
+ email: Joseph.Chen@citygridmedia.com
115
116
  executables: []
116
117
  extensions: []
117
118
  extra_rdoc_files:
118
119
  - LICENSE.txt
119
- - README
120
120
  - README.rdoc
121
121
  files:
122
122
  - .document
@@ -125,26 +125,23 @@ files:
125
125
  - Gemfile
126
126
  - Gemfile.lock
127
127
  - LICENSE.txt
128
- - README
129
128
  - README.rdoc
130
129
  - Rakefile
131
130
  - VERSION
132
131
  - citygrid_api.gemspec
133
- - citygrid_api.yml.backup
134
132
  - citygrid_api.yml.sample
133
+ - citygrid_api.yml.sandbox
135
134
  - config.ru
136
135
  - dashboard.rb
137
136
  - fixtures/vcr_cassettes/AdGroupCriterion_mutate.yml
138
137
  - fixtures/vcr_cassettes/AdGroupCriterion_search.yml
139
138
  - fixtures/vcr_cassettes/Adding_a_place.yml
140
- - fixtures/vcr_cassettes/Call_Detail_by_campaign.yml
141
139
  - fixtures/vcr_cassettes/Geo.yml
140
+ - fixtures/vcr_cassettes/Getting_an_offer.yml
142
141
  - fixtures/vcr_cassettes/Getting_an_offer_by_listing_ID.yml
143
142
  - fixtures/vcr_cassettes/Import_a_cg_account.yml
144
143
  - fixtures/vcr_cassettes/Initiating_a_Details.yml
145
144
  - fixtures/vcr_cassettes/Initiating_new_MultiDetails.yml
146
- - fixtures/vcr_cassettes/Method_of_Payment_mutate.yml
147
- - fixtures/vcr_cassettes/Method_of_Payment_search.yml
148
145
  - fixtures/vcr_cassettes/Mutating_AdGroup_Ads.yml
149
146
  - fixtures/vcr_cassettes/Report_summary_daily.yml
150
147
  - fixtures/vcr_cassettes/Report_summary_user_actions.yml
@@ -156,14 +153,23 @@ files:
156
153
  - fixtures/vcr_cassettes/Searching_categories_by_listing_id.yml
157
154
  - fixtures/vcr_cassettes/Searching_categories_by_query.yml
158
155
  - fixtures/vcr_cassettes/Upload_an_image_Add_a_preview.yml
156
+ - fixtures/vcr_cassettes/create_a_mop.yml
157
+ - fixtures/vcr_cassettes/create_an_offer.yml
159
158
  - fixtures/vcr_cassettes/create_campaign.yml
159
+ - fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign.yml
160
+ - fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign_then_search_.yml
161
+ - fixtures/vcr_cassettes/getting_reviews_by_listing_id.yml
160
162
  - fixtures/vcr_cassettes/log_in_a_session.yml
161
163
  - fixtures/vcr_cassettes/log_in_a_session_mutate_places.yml
162
164
  - fixtures/vcr_cassettes/query_account_type_by_id.yml
163
165
  - fixtures/vcr_cassettes/search_for_an_account_by_id.yml
164
166
  - fixtures/vcr_cassettes/search_for_an_account_by_name.yml
167
+ - fixtures/vcr_cassettes/search_for_call_detail_by_campaign.yml
168
+ - fixtures/vcr_cassettes/search_for_mop_by_account_id.yml
165
169
  - fixtures/vcr_cassettes/searching_for_a_CityGrid_listing.yml
166
170
  - fixtures/vcr_cassettes/searching_for_a_special_CityGrid_listing.yml
171
+ - fixtures/vcr_cassettes/user_log_in_with_raw_API.yml
172
+ - fixtures/vcr_cassettes/user_log_in_with_session.yml
167
173
  - lib/citygrid.rb
168
174
  - lib/citygrid/abstraction.rb
169
175
  - lib/citygrid/abstraction/collection.rb
@@ -190,13 +196,15 @@ files:
190
196
  - lib/citygrid/api/advertising/category.rb
191
197
  - lib/citygrid/api/advertising/geolocation.rb
192
198
  - lib/citygrid/api/advertising/image.rb
199
+ - lib/citygrid/api/advertising/offers.rb
193
200
  - lib/citygrid/api/advertising/performance.rb
194
201
  - lib/citygrid/api/advertising/places.rb
195
202
  - lib/citygrid/api/content.rb
196
203
  - lib/citygrid/api/content/offers.rb
197
204
  - lib/citygrid/api/content/places.rb
205
+ - lib/citygrid/api/content/response.rb
198
206
  - lib/citygrid/api/content/reviews.rb
199
- - lib/citygrid/api/mutatable.rb
207
+ - lib/citygrid/api/mutable.rb
200
208
  - lib/citygrid/api/response.rb
201
209
  - lib/citygrid/api/searchable.rb
202
210
  - lib/citygrid/details.rb
@@ -214,6 +222,7 @@ files:
214
222
  - public/javascript/dashboard.js
215
223
  - test/api/accounts/test_account.rb
216
224
  - test/api/accounts/test_method_of_payment.rb
225
+ - test/api/accounts/test_user.rb
217
226
  - test/api/advertising/test_account_manager.rb
218
227
  - test/api/advertising/test_ad_group.rb
219
228
  - test/api/advertising/test_ad_group_ad.rb
@@ -226,10 +235,13 @@ files:
226
235
  - test/api/advertising/test_create_campaign_and_ad_group.rb
227
236
  - test/api/advertising/test_geolocation.rb
228
237
  - test/api/advertising/test_image.rb
238
+ - test/api/advertising/test_offers.rb
229
239
  - test/api/advertising/test_performance.rb
230
240
  - test/api/advertising/test_places.rb
231
241
  - test/api/content/test_details.rb
232
242
  - test/api/content/test_offers.rb
243
+ - test/api/content/test_response.rb
244
+ - test/api/content/test_reviews.rb
233
245
  - test/api/content/test_search.rb
234
246
  - test/auth_token.rb
235
247
  - test/helper.rb
@@ -268,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
280
  version: '0'
269
281
  requirements: []
270
282
  rubyforge_project:
271
- rubygems_version: 1.8.12
283
+ rubygems_version: 1.8.10
272
284
  signing_key:
273
285
  specification_version: 3
274
286
  summary: Ruby wrapper for CityGrid APIs
data/README DELETED
@@ -1,21 +0,0 @@
1
- = citygrid
2
-
3
- Don't use this. NOT PRODUCTION READY
4
-
5
- Description goes here.
6
-
7
- == Contributing to citygrid
8
-
9
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
10
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
11
- * Fork the project
12
- * Start a feature/bugfix branch
13
- * Commit and push until you are happy with your contribution
14
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
15
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
16
-
17
- == Copyright
18
-
19
- Copyright (c) 2011 Elpizo Choi. See LICENSE.txt for
20
- further details.
21
-
@@ -1,35 +0,0 @@
1
- defaults:
2
- hostname: api.qa.citygrid.com
3
- ssl_hostname: api-qassl.citygrid.com
4
-
5
- # endpoint_name: endpoint
6
- # OR
7
- # endpoint_name:
8
- # ssl: true/false
9
- # endpoint: endpoint
10
-
11
- endpoints:
12
- account:
13
- ssl: true
14
- endpoint: accounts/account/v2
15
- account_manager: advertising/campaign/v2/accountmanager
16
- ad_group: advertising/adgroup/v2
17
- ad_group_ad: advertising/adgroupad/v2
18
- ad_group_criterion: advertising/adgroupcriterion/v2
19
- ad_group_geo: advertising/adgroupgeo/v2
20
- authentication:
21
- ssl: true
22
- endpoint: accounts/user/v2
23
- billing: advertising/billing/v2
24
- budget: advertising/budget/v2/recommend
25
- campaign: advertising/campaign/v2
26
- category: content/category/v2
27
- geo_location: content/places/v2/geocode
28
- image: advertising/image/v2
29
- method_of_payment:
30
- ssl: true
31
- endpoint: accounts/mop/v2
32
- places: content/places/v2
33
- performance: advertising/performance/v2/campaign
34
- user: accounts/user/v2
35
- call_detail: advertising/calldetail/v2
@@ -1,79 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :post
5
- uri: http://api.qa.citygrid.com:80/advertising/calldetail/v2/campaign
6
- body: ! '{"campaignId":786,"period":"last30Days"}'
7
- headers:
8
- accept:
9
- - application/json
10
- content-type:
11
- - Application/JSON
12
- authtoken:
13
- - 563da3d1cfa3a8e75f6a09e89f542d67
14
- response: !ruby/struct:VCR::Response
15
- status: !ruby/struct:VCR::ResponseStatus
16
- code: 200
17
- message: OK
18
- headers:
19
- date:
20
- - Fri, 30 Dec 2011 01:06:05 GMT
21
- server:
22
- - Apache-Coyote/1.1
23
- content-type:
24
- - application/json
25
- vary:
26
- - Accept-Encoding
27
- transfer-encoding:
28
- - chunked
29
- body: ! '{"request":{"campaignId":"786","period":"last30Days"},"response":{"code":200,"message":"OK"},"totalNumEntries":1,"callDetailsResources":[{"response":{"code":200,"message":"OK"},"campaignId":786,"campaignName":"CampaignRest1stTest-786","callDetails":[{"accountId":111,"accountName":"Enchiladas
30
- Y Mas, Inc.","callId":"12ADCAB3FA5942D5BD85200DAA4C055E","callStartTime":1322775830000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124978784","duration":25,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
31
- Y Mas, Inc.","callId":"F89838F633B643CE8A660285A81A9D91","callStartTime":1323187204000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":21,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
32
- Y Mas, Inc.","callId":"657F4663AB0A437581C074F38F90B129","callStartTime":1324420988000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5129185602","duration":48,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
33
- Y Mas, Inc.","callId":"BFD3445200F64EDD9DD8F4A2A838F42D","callStartTime":1324481144000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":21,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
34
- Y Mas, Inc.","callId":"1A5E9022F3ED46438403C419D0888DBF","callStartTime":1323531362000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":17,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
35
- Y Mas, Inc.","callId":"43A0FE55C6B84CB584820BD2474F9495","callStartTime":1324727505000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":16,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
36
- Y Mas, Inc.","callId":"A37A5F5BE7C44AAAABF6AF15415253E8","callStartTime":1324670052000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124191446","duration":67,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
37
- Y Mas, Inc.","callId":"290623B05E994268BF998DC3A000D7CB","callStartTime":1324396351000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":46,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
38
- Y Mas, Inc.","callId":"B5992670FE154F03AA5B7ED83126E6B3","callStartTime":1322846176000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5126331212","duration":21,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
39
- Y Mas, Inc.","callId":"1F08AC674B4E4611AD2515A875DBDD6E","callStartTime":1323207661000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":8,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
40
- Y Mas, Inc.","callId":"C6A070D2D2294544A817588404AA4229","callStartTime":1323640826000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5122286580","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
41
- Y Mas, Inc.","callId":"1539CEFCAB59474AA21BA9BB0E4D3D7D","callStartTime":1323876268000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
42
- Y Mas, Inc.","callId":"D493D71D3EE5453086E4BD32663144E7","callStartTime":1323547023000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5126659137","duration":10,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
43
- Y Mas, Inc.","callId":"2D5F77A94B894CF495FB5C83BA21C26E","callStartTime":1323181615000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5127861118","duration":39,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
44
- Y Mas, Inc.","callId":"439BF2DA64BB4204AAF5F9AADA29C835","callStartTime":1323963549000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5129185602","duration":30,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
45
- Y Mas, Inc.","callId":"29E56E60C0F74F38B0E6FB105340E002","callStartTime":1323876244000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
46
- Y Mas, Inc.","callId":"A8F1C018C8074D64BC5EA391DB2F5BDC","callStartTime":1324920090000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5126194174","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
47
- Y Mas, Inc.","callId":"77CBAFB25B7540FD8A421B4444A2DB3B","callStartTime":1324745799000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5127968208","duration":11,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
48
- Y Mas, Inc.","callId":"9E148481969347D4A775A9229D766B49","callStartTime":1323789667000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
49
- Y Mas, Inc.","callId":"978B1DA923114641BEFFB0880F2E2A98","callStartTime":1323357297000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":25,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
50
- Y Mas, Inc.","callId":"21A21CBDE41241CC97ECED776F5B074D","callStartTime":1323789679000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
51
- Y Mas, Inc.","callId":"52CBA12FEBCA43CCBD90C3DD826951FE","callStartTime":1324322226000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
52
- Y Mas, Inc.","callId":"4E087A4571854412A650FEC16ACC6A90","callStartTime":1322750962000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5127861118","duration":43,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
53
- Y Mas, Inc.","callId":"104FC65DDA0F40E5B8531F58F2D27E96","callStartTime":1323291253000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":24,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
54
- Y Mas, Inc.","callId":"336C33670AE5492F9C2FF5C1EDEF8F26","callStartTime":1322680630000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":37,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
55
- Y Mas, Inc.","callId":"E02C35477CD7445686F40A77FC02D9FF","callStartTime":1324499372000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5128282932","duration":21,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
56
- Y Mas, Inc.","callId":"CF0B5C4135BB4BEA8E76A6553CAE9D8F","callStartTime":1324322205000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
57
- Y Mas, Inc.","callId":"C50347F1330C4C00B0E2F3D3C1378197","callStartTime":1323876221000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
58
- Y Mas, Inc.","callId":"BBC9B7056981414C9940F6282472168A","callStartTime":1323640910000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5122286580","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
59
- Y Mas, Inc.","callId":"D3090087D59B45AAA74E7F197E17A9FF","callStartTime":1322761891000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":13,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
60
- Y Mas, Inc.","callId":"DD8A35D9AFCA447BAF68D11C8F13EB5C","callStartTime":1323200390000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5129187028","duration":233,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
61
- Y Mas, Inc.","callId":"FAA58351421C481F8E976836422C1FBB","callStartTime":1323446032000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":34,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
62
- Y Mas, Inc.","callId":"EA1D388DB4DF48BFB97F3D57E72A4E4C","callStartTime":1323386373000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5128320013","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
63
- Y Mas, Inc.","callId":"CD7E221BAEDF489CA4CA95495C1ABA0A","callStartTime":1323789650000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
64
- Y Mas, Inc.","callId":"3598953125454A3B938464078AC56E98","callStartTime":1323964059000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":26,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
65
- Y Mas, Inc.","callId":"FB5F12788B8D4B01B931160AF4AA3A5F","callStartTime":1324154106000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124548701","duration":17,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
66
- Y Mas, Inc.","callId":"D1AAEA7351F14DC589141A0E77E73020","callStartTime":1324687556000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124548701","duration":9,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
67
- Y Mas, Inc.","callId":"124163A136544C769BF6047279377D26","callStartTime":1324134173000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5126898625","duration":28,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
68
- Y Mas, Inc.","callId":"BE0C25C8A2EB46529DAB094E252990EE","callStartTime":1325114868000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124614381","duration":11,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
69
- Y Mas, Inc.","callId":"184E5E0C7D09419D95801CB567F98550","callStartTime":1323612923000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5127960637","duration":29,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
70
- Y Mas, Inc.","callId":"586B9865604C484CAC89D2D88C3E2E95","callStartTime":1322846363000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5125523365","duration":18,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
71
- Y Mas, Inc.","callId":"2EFE17BDD29E44C9B5E5B59FD15F53D2","callStartTime":1324686900000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124134037","duration":82,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
72
- Y Mas, Inc.","callId":"0D53F7BF0351430CA0510D2673304922","callStartTime":1323531469000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5126898625","duration":51,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
73
- Y Mas, Inc.","callId":"41C956572C494F54AA72A2D14139F6AF","callStartTime":1323876151000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
74
- Y Mas, Inc.","callId":"61B3160E54CC44639B570238ACE4F011","callStartTime":1323876487000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
75
- Y Mas, Inc.","callId":"D5178E46076F40A7B1E6877C0018F2CC","callStartTime":1324576405000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5125417773","duration":52,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
76
- Y Mas, Inc.","callId":"D4CF93CBAA5D467583513F07D90C7A66","callStartTime":1324153943000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5124548701","duration":86,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
77
- Y Mas, Inc.","callId":"B2C73AA33ACD4718A8EF7E6A434FAEA2","callStartTime":1322660117000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"5128037243","duration":37,"rating":null,"classification":null,"notes":null,"audioUrl":""},{"accountId":111,"accountName":"Enchiladas
78
- Y Mas, Inc.","callId":"3626AFB219084A2A89870616D087E089","callStartTime":1323876136000,"ringToNumber":"5124677100","trackableNumber":"5123716495","callerPhone":"8066790115","duration":0,"rating":null,"classification":null,"notes":null,"audioUrl":""}]}]}'
79
- http_version: '1.1'