Skip to content

Commit

Permalink
Updating calldetail endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjo authored and chenjo committed Jan 13, 2012
1 parent 8f60b32 commit 97eeaac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 3 additions & 1 deletion citygrid_api.yml.sample
Expand Up @@ -29,7 +29,9 @@ api:
ad_group_geo: advertising/adgroupgeo/v2
budget: advertising/budget/v2/recommend
billing: advertising/billing/v2
call_detail: advertising/calldetail/v2
call_detail:
endpoint: report/calldetail/v2
hostname: lax1qatxpi4.test.cs:8080
campaign: advertising/campaign/v2
category: content/category/v2
geo_location: content/places/v2/geocode
Expand Down
4 changes: 2 additions & 2 deletions lib/citygrid/api/advertising/call_detail.rb
@@ -1,8 +1,8 @@
class CityGrid
class API
class Advertising
class CallDetail < Advertising
define_action :campaign, :post, "campaign", :auth_token => true, :format => false
class CallDetail < Advertising
define_action :search, :post, "get", :auth_token => true, :format => false
define_action :note, :post, "note", :auth_token => true, :format => false
end
end
Expand Down
17 changes: 16 additions & 1 deletion test/api/advertising/test_call_detail.rb
@@ -1,10 +1,11 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))

context "search for call detail" do
set :vcr, false
context "by campaign" do
setup do
SessionHelper.sales_coord.call_api CityGrid::API::Advertising::CallDetail,
:campaign,
:search,
:campaignId => 786,
:period => 'last30Days'
end
Expand All @@ -13,7 +14,21 @@
topic.callDetailsResources.length > 0
}
end

context "by adgroup" do
setup do
SessionHelper.sales_coord.call_api CityGrid::API::Advertising::CallDetail,
:search,
:adGroupId => 7264632,
:period => 'last30Days'
end
should("not be empty"){ !topic.empty? }
should("have call detail resources"){
topic.callDetailsResources.length > 0
}
end

# Can't really do this test if can't reliably access the same note again and again
# context "note" do
# setup do
# run_with_rescue do
Expand Down

0 comments on commit 97eeaac

Please sign in to comment.