test/client_test.rb in 3scale_client-2.5.0 vs test/client_test.rb in 3scale_client-2.6.0
- old
+ new
@@ -3,11 +3,11 @@
require 'fakeweb'
require 'mocha/setup'
require '3scale/client'
-class ThreeScale::ClientTest < MiniTest::Unit::TestCase
+class ThreeScale::ClientTest < MiniTest::Test
def client(options = {})
ThreeScale::Client.new({:provider_key => '1234abcd'}.merge(options))
end
@@ -340,10 +340,13 @@
payload = {
'transactions[0][app_id]' => 'foo',
'transactions[0][timestamp]' => CGI.escape('2010-04-27 15:42:17 0200'),
'transactions[0][usage][hits]' => '1',
+ 'transactions[0][log][request]' => 'foo',
+ 'transactions[0][log][response]' => 'bar',
+ 'transactions[0][log][code]' => '200',
'transactions[1][app_id]' => 'bar',
'transactions[1][timestamp]' => CGI.escape('2010-04-27 15:55:12 0200'),
'transactions[1][usage][hits]' => '1',
'provider_key' => '1234abcd'
}
@@ -352,10 +355,16 @@
.with('/transactions.xml', payload)
.returns(http_response)
@client.report({:app_id => 'foo',
:usage => {'hits' => 1},
- :timestamp => '2010-04-27 15:42:17 0200'},
+ :timestamp => '2010-04-27 15:42:17 0200',
+ :log => {
+ 'request' => 'foo',
+ 'response' => 'bar',
+ 'code' => 200,
+ }
+ },
{:app_id => 'bar',
:usage => {'hits' => 1},
:timestamp => '2010-04-27 15:55:12 0200'})
end