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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a92135ecef16e5e7f165c9fa042bbbe27b03346
4
- data.tar.gz: 3c6983207542025e882bbf0549bf3879b65bee3e
3
+ metadata.gz: 8a264b90e0574ee7d010bf2b194791ca197b0fb4
4
+ data.tar.gz: a759d45f7ea385836135fbcbeca5f295976fb214
5
5
  SHA512:
6
- metadata.gz: d8e57b4cde27df38ff33a0d209eb01cc1212c7d41662b35f86afa4d929b902c63cb5d89954e6e65770d3f2fc6dbbd21f2c3cf4c7b2a6f1c8556dcfa270dfe3fd
7
- data.tar.gz: 7f277adeb140d6e34aa3d0fdabe3675243058b5c36d9852a02b7c56a601acfbdf0ffe158fc62ba7ba63160c405db7ca9b2c31e69890c03127a6b7c018233af68
6
+ metadata.gz: aec5d0eec3c7027b4c6c6c06dc09fa682a12773276bcef3e4abcc3953cadcd900f10768bc2687efca33a408eca51dde60ab456d87ad8d0dbe973b6c56492724c
7
+ data.tar.gz: 13138d5b997c71ca8511a099e9101c1f9afd5ad50c82dcee3808d3294a3b820fa14dc715967f2de7b79653656716285886ba3e661c745b71a9f3452f726b7757
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.5.3
2
+ - [#55] Offer set affiliate status. (@moofkit)
3
+
1
4
  # 0.5.2
2
5
  - [#54] Added Offer::addGroup method
3
6
  - [#51] Added Offer::create, Offer::addTargetCountry and Offer::unblockAffiliate methods
@@ -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 unblock_affilate(params = {})
82
+ def unblock_affiliate(params = {})
79
83
  requires! params, [:id, :affiliate_id]
80
- post_request 'unblockAffilate', params
84
+ post_request 'unblockAffiliate', params
81
85
  end
82
86
  end
83
87
  end
@@ -1,3 +1,3 @@
1
1
  class HasOffersV3
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
@@ -185,21 +185,21 @@ describe HasOffersV3::Offer do
185
185
  end
186
186
  end
187
187
 
188
- describe '#unblock_affilate' do
188
+ describe '#unblock_affiliate' do
189
189
  it 'makes a proper request call' do
190
190
  stub_call
191
- response = subject.unblock_affilate id: 1, affiliate_id: 123
191
+ response = subject.unblock_affiliate id: 1, affiliate_id: 123
192
192
  expect(a_request(:post, url).with(
193
- body: hash_including({'Method' => 'unblockAffilate','id' => '1','affiliate_id' => '123'}))
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.unblock_affilate affiliate_id: 1 }.to raise_error ArgumentError
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.unblock_affilate id: 10 }.to raise_error ArgumentError
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.2
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-10-31 00:00:00.000000000 Z
12
+ date: 2016-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport