paypal-sdk-rest 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paypal-sdk/rest/data_types.rb +3 -2
- data/lib/paypal-sdk/rest/version.rb +1 -1
- data/spec/log/http.log +537 -0
- data/spec/web_profile_examples_spec.rb +27 -16
- metadata +3 -3
@@ -23,42 +23,51 @@ describe "WebProfiles" do
|
|
23
23
|
describe "Examples" do
|
24
24
|
describe "WebProfile", :integration => true do
|
25
25
|
it "Create" do
|
26
|
+
|
26
27
|
api = API.new
|
27
28
|
$webprofile = WebProfile.new(WebProfileAttributes.merge( :token => api.token ))
|
29
|
+
|
30
|
+
# generate a random number and append it to name
|
31
|
+
suffix = Random.rand(1000000000).to_s
|
32
|
+
$randname = $webprofile.name + suffix
|
33
|
+
$webprofile.name = $randname
|
34
|
+
|
35
|
+
# create webhook
|
28
36
|
$webprofile.create
|
29
|
-
expect($webprofile.name.to_s).to eq(
|
37
|
+
expect($webprofile.name.to_s).to eq($randname)
|
30
38
|
end
|
31
39
|
|
32
40
|
it "List" do
|
33
41
|
list = WebProfile.get_list
|
34
42
|
expect(list.size).to be > 1
|
43
|
+
expect(list.first).to be_an_instance_of(WebProfileList)
|
35
44
|
end
|
36
45
|
|
37
46
|
it "Retrieve" do
|
38
|
-
webprofile = WebProfile.find(
|
39
|
-
expect(webprofile.name.to_s).to eq(
|
47
|
+
webprofile = WebProfile.find($webprofile.id)
|
48
|
+
expect(webprofile.name.to_s).to eq($randname)
|
40
49
|
end
|
41
50
|
|
42
51
|
it "Update" do
|
43
52
|
# append "-test" to web profile name
|
44
|
-
webprofile = WebProfile.find(
|
53
|
+
webprofile = WebProfile.find($webprofile.id)
|
45
54
|
webprofile.name += "-test"
|
46
55
|
webprofile.update
|
47
56
|
|
48
57
|
# check whether the name was updated
|
49
|
-
webprofile = WebProfile.find(
|
50
|
-
expect(webprofile.name).to eq(
|
51
|
-
webprofile.name =
|
58
|
+
webprofile = WebProfile.find($webprofile.id)
|
59
|
+
expect(webprofile.name).to eq($randname + "-test")
|
60
|
+
webprofile.name = $randname
|
52
61
|
webprofile.update
|
53
62
|
|
54
63
|
# revert updated profile name for next test run
|
55
|
-
webprofile = WebProfile.find(
|
56
|
-
expect(webprofile.name).to eq(
|
64
|
+
webprofile = WebProfile.find($webprofile.id)
|
65
|
+
expect(webprofile.name).to eq($randname)
|
57
66
|
end
|
58
67
|
|
59
68
|
it "Partial update" do
|
60
69
|
# retrieve web profile to perform partial update on
|
61
|
-
webprofile = WebProfile.find(
|
70
|
+
webprofile = WebProfile.find($webprofile.id)
|
62
71
|
|
63
72
|
# set up partial update
|
64
73
|
h = {"op" => "replace",
|
@@ -67,7 +76,7 @@ describe "WebProfiles" do
|
|
67
76
|
|
68
77
|
# do partial update by sending a patch request
|
69
78
|
expect(webprofile.partial_update( [h] )).to be_truthy
|
70
|
-
webprofile = WebProfile.find(
|
79
|
+
webprofile = WebProfile.find($webprofile.id)
|
71
80
|
expect(webprofile.presentation.brand_name).to eq("new_brand_name")
|
72
81
|
|
73
82
|
# restore original value for the next test run
|
@@ -75,18 +84,20 @@ describe "WebProfiles" do
|
|
75
84
|
"path" => "/presentation/brand_name",
|
76
85
|
"value" => "brand_name"}
|
77
86
|
expect(webprofile.partial_update( [h] )).to be_truthy
|
78
|
-
expect(WebProfile.find(
|
87
|
+
expect(WebProfile.find($webprofile.id).presentation.brand_name).to eq("brand_name")
|
79
88
|
end
|
80
89
|
|
81
90
|
it "Delete" do
|
82
|
-
puts $webprofile.inspect
|
83
91
|
# delete newly created web profile from above create test
|
84
92
|
expect($webprofile.delete).to be_truthy
|
85
93
|
|
86
94
|
# make sure it is not retrieved from the system
|
87
|
-
|
88
|
-
|
89
|
-
|
95
|
+
begin
|
96
|
+
webprofile = WebProfile.find($webprofile.id)
|
97
|
+
expect(webprofile).to be_nil
|
98
|
+
fail "WebProfile with ID=#{$webprofile.id} has not been deleted"
|
99
|
+
rescue ResourceNotFound
|
100
|
+
end
|
90
101
|
end
|
91
102
|
end
|
92
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-sdk-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
description: The PayPal REST SDK provides Ruby APIs to create, process and manage
|
70
70
|
payment.
|
71
71
|
email:
|
72
|
-
- DL-PP-RUBY-SDK@
|
72
|
+
- DL-PP-RUBY-SDK@paypal.com
|
73
73
|
executables: []
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|