hasoffersv3 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/hasoffersv3/offer.rb +7 -3
- data/lib/hasoffersv3/version.rb +1 -1
- data/spec/lib/offer_spec.rb +27 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a264b90e0574ee7d010bf2b194791ca197b0fb4
|
4
|
+
data.tar.gz: a759d45f7ea385836135fbcbeca5f295976fb214
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec5d0eec3c7027b4c6c6c06dc09fa682a12773276bcef3e4abcc3953cadcd900f10768bc2687efca33a408eca51dde60ab456d87ad8d0dbe973b6c56492724c
|
7
|
+
data.tar.gz: 13138d5b997c71ca8511a099e9101c1f9afd5ad50c82dcee3808d3294a3b820fa14dc715967f2de7b79653656716285886ba3e661c745b71a9f3452f726b7757
|
data/CHANGELOG.md
CHANGED
data/lib/hasoffersv3/offer.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
class HasOffersV3
|
2
2
|
class Offer < Base
|
3
|
-
|
4
3
|
def add_group(params)
|
5
4
|
requires! params, [:id, :group_id]
|
6
5
|
post_request 'addGroup', params
|
@@ -50,6 +49,11 @@ class HasOffersV3
|
|
50
49
|
post_request 'getApprovedAffiliateIds', params
|
51
50
|
end
|
52
51
|
|
52
|
+
def set_affiliate_approval(params = {})
|
53
|
+
requires! params, [:id, :affiliate_id, :status]
|
54
|
+
post_request 'setAffiliateApproval', params
|
55
|
+
end
|
56
|
+
|
53
57
|
def set_payout(params = {})
|
54
58
|
requires! params, [:id, :affiliate_id]
|
55
59
|
post_request 'setPayout', params
|
@@ -75,9 +79,9 @@ class HasOffersV3
|
|
75
79
|
post_request 'getTierPayouts', params
|
76
80
|
end
|
77
81
|
|
78
|
-
def
|
82
|
+
def unblock_affiliate(params = {})
|
79
83
|
requires! params, [:id, :affiliate_id]
|
80
|
-
post_request '
|
84
|
+
post_request 'unblockAffiliate', params
|
81
85
|
end
|
82
86
|
end
|
83
87
|
end
|
data/lib/hasoffersv3/version.rb
CHANGED
data/spec/lib/offer_spec.rb
CHANGED
@@ -185,21 +185,21 @@ describe HasOffersV3::Offer do
|
|
185
185
|
end
|
186
186
|
end
|
187
187
|
|
188
|
-
describe '#
|
188
|
+
describe '#unblock_affiliate' do
|
189
189
|
it 'makes a proper request call' do
|
190
190
|
stub_call
|
191
|
-
response = subject.
|
191
|
+
response = subject.unblock_affiliate id: 1, affiliate_id: 123
|
192
192
|
expect(a_request(:post, url).with(
|
193
|
-
body: hash_including({'Method' => '
|
193
|
+
body: hash_including({'Method' => 'unblockAffiliate','id' => '1','affiliate_id' => '123'}))
|
194
194
|
).to have_been_made
|
195
195
|
end
|
196
196
|
|
197
197
|
context 'when required params are missing' do
|
198
198
|
it 'fails without id' do
|
199
|
-
expect { subject.
|
199
|
+
expect { subject.unblock_affiliate affiliate_id: 1 }.to raise_error ArgumentError
|
200
200
|
end
|
201
201
|
it 'fails without affiliate_id' do
|
202
|
-
expect { subject.
|
202
|
+
expect { subject.unblock_affiliate id: 10 }.to raise_error ArgumentError
|
203
203
|
end
|
204
204
|
end
|
205
205
|
end
|
@@ -242,4 +242,26 @@ describe HasOffersV3::Offer do
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
end
|
245
|
+
|
246
|
+
describe '#set_affiliate_approval' do
|
247
|
+
it 'makes a proper request call' do
|
248
|
+
stub_call
|
249
|
+
response = subject.set_affiliate_approval id: 1, affiliate_id: 123, status: 'approved'
|
250
|
+
expect(a_request(:post, url).with(
|
251
|
+
body: hash_including({'Method' => 'setAffiliateApproval','id' => '1','affiliate_id' => '123', 'status' => 'approved'}))
|
252
|
+
).to have_been_made
|
253
|
+
end
|
254
|
+
|
255
|
+
context 'when required params are missing' do
|
256
|
+
it 'fails without id' do
|
257
|
+
expect { subject.set_affiliate_approval affiliate_id: 1, status: 'approved' }.to raise_error ArgumentError
|
258
|
+
end
|
259
|
+
it 'fails without affiliate_id' do
|
260
|
+
expect { subject.set_affiliate_approval id: 10, status: 'approved' }.to raise_error ArgumentError
|
261
|
+
end
|
262
|
+
it 'fails without status' do
|
263
|
+
expect { subject.set_affiliate_approval id: 10, affiliate_id: 1 }.to raise_error ArgumentError
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
245
267
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hasoffersv3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maximilian Seifert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|