-
Notifications
You must be signed in to change notification settings - Fork 21
/
agreement_test.rb
36 lines (30 loc) · 1005 Bytes
/
agreement_test.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
require File.expand_path('../test_assistant', __FILE__)
module Pingpp
class AgreementTest < Test::Unit::TestCase
should "execute should return a agreement list when passed correct parameters" do
l = Pingpp::Agreement.list(
:app => get_app_id,
:per_page => 3
)
assert l.object == 'list'
assert l.data.count <= 3
end
should "execute should return an exist agreement when passed correct agreement id" do
agr_id = get_agreement_id
c = Pingpp::Agreement.retrieve(agr_id)
assert c.object == 'agreement'
assert c.id == agr_id
end
should "execute should return an canceled agreement" do
begin
agr_id = get_agreement_id
o = Pingpp::Agreement.cancel(agr_id)
assert o.id == agr_id
assert o.status == 'canceled'
rescue => e
assert e.kind_of?(Pingpp::InvalidRequestError)
assert e.message.include?("该签约对象不能被更新状态")
end
end
end
end