Sha256: 9202687f5cd8d09863c68f9b087c28ceadc38335b22625804d7818aa0fff19b9
Contents?: true
Size: 1.64 KB
Versions: 3
Compression:
Stored size: 1.64 KB
Contents
RSpec.describe SoapyCake::Admin do it 'returns an affiliate with correct data types', :vcr do result = subject.affiliates(affiliate_id: 16027) expect(result.count).to eq(1) expect(result.first).to include( affiliate_id: 16027, # strings affiliate_name: 'Affiliate Test 1', # booleans hide_offers: false, # hashes and id-params billing_cycle: { billing_cycle_id: 1, billing_cycle_name: 'Weekly' }, # dates date_created: DateTime.new(2014, 4, 28, 10, 52, 15.537), # floats minimum_payment_threshold: '0.0000' ) # strings should be actual Strings, not some Saxerator element class expect(result.first[:affiliate_name].class).to eq(String) # arrays expect(result.first[:contacts][:contact_info].map { |contact| contact[:contact_id] }).to \ eq([8819, 8820]) end it 'returns a clicks report with a defined time range', :vcr do result = subject.clicks( start_date: Date.new(2014, 6, 30), end_date: Date.new(2014, 7, 1), row_limit: 1 ) expect(result.count).to eq(1) expect(result.first).to include( click_id: 1275452, visitor_id: 1208222 ) end it 'does not parse a transaction_id as an integer', :vcr do result = subject.conversions( start_date: Date.new(2015, 4, 11), end_date: Date.new(2015, 4, 12), row_limit: 1 ) expect(result.count).to eq(1) expect(result.first[:transaction_id]).to eq('TRANSACTION_ID') end it 'raises if there is an error', :vcr do expect do subject.affiliates(affiliate_id: 'bloops') end.to raise_error(SoapyCake::RequestFailed) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
soapy_cake-1.8.0 | spec/integration/soapy_cake/admin_spec.rb |
soapy_cake-1.7.2 | spec/integration/soapy_cake/admin_spec.rb |
soapy_cake-1.7.1 | spec/integration/soapy_cake/admin_spec.rb |