-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_call_detail.rb
45 lines (42 loc) · 1.28 KB
/
test_call_detail.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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,
:search,
:campaignId => 786,
:period => 'last30Days'
end
should("not be empty"){ !topic.empty? }
should("have call detail resources"){
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
# CityGrid::API::Advertising::CallDetail.note(
# :campaignId => 786,
# :period => 'last30Days',
# :token => token
# )
# end
# end
# should("not be empty"){ !topic.empty? }
# should("have user actions"){ topic.userActions.length > 0 }
# end
end