infomeme_client 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- metadata +26 -165
- data/.document +0 -5
- data/.gitignore +0 -21
- data/LICENSE +0 -20
- data/README.rdoc +0 -8
- data/Rakefile +0 -55
- data/VERSION +0 -1
- data/lib/infomeme_client.rb +0 -22
- data/lib/infomeme_client/base.rb +0 -77
- data/lib/infomeme_client/communication.rb +0 -75
- data/lib/infomeme_client/entity_hash.rb +0 -66
- data/lib/infomeme_client/entity_hash/comment.rb +0 -2
- data/lib/infomeme_client/entity_hash/invoice.rb +0 -2
- data/lib/infomeme_client/entity_hash/meme.rb +0 -45
- data/lib/infomeme_client/entity_hash/meme_type.rb +0 -2
- data/lib/infomeme_client/entity_hash/transaction.rb +0 -2
- data/lib/infomeme_client/entity_hash/user.rb +0 -2
- data/lib/infomeme_client/errors.rb +0 -22
- data/lib/infomeme_client/functions.rb +0 -16
- data/lib/infomeme_client/functions/meme.rb +0 -23
- data/lib/infomeme_client/functions/user.rb +0 -79
- data/lib/infomeme_client/functions/user_meme.rb +0 -127
- data/lib/infomeme_client/functions/user_order.rb +0 -31
- data/lib/infomeme_client/meme_application.rb +0 -18
- data/lib/infomeme_client/permissions.rb +0 -22
- data/lib/infomeme_client/response.rb +0 -52
- data/test/fixtures/memes/comments.json +0 -1
- data/test/fixtures/memes/meme.json +0 -1
- data/test/fixtures/memes/memes.json +0 -1
- data/test/fixtures/memes/types.json +0 -1
- data/test/fixtures/oauth/access_token.json +0 -1
- data/test/fixtures/oauth/authorize.json +0 -1
- data/test/fixtures/oauth/permissions.json +0 -1
- data/test/fixtures/oauth/request_token.json +0 -1
- data/test/fixtures/oauth/verify_access.json +0 -1
- data/test/fixtures/response/error.json +0 -1
- data/test/fixtures/response/ok.json +0 -1
- data/test/fixtures/response/test.json +0 -1
- data/test/fixtures/response/test_extract.json +0 -1
- data/test/fixtures/users/invoice.json +0 -1
- data/test/fixtures/users/invoices.json +0 -1
- data/test/fixtures/users/memes.json +0 -1
- data/test/fixtures/users/order_paypal.json +0 -1
- data/test/fixtures/users/permissions.json +0 -1
- data/test/fixtures/users/transactions.json +0 -1
- data/test/fixtures/users/user.json +0 -1
- data/test/fixtures/users/user_public.json +0 -1
- data/test/helper.rb +0 -69
- data/test/test_authorization.rb +0 -56
- data/test/test_communication.rb +0 -46
- data/test/test_entity_hash.rb +0 -15
- data/test/test_meme_functions.rb +0 -46
- data/test/test_permissions.rb +0 -25
- data/test/test_user_functions.rb +0 -15
- data/test/test_user_meme_functions.rb +0 -47
- data/test/test_user_order_functions.rb +0 -45
@@ -1,45 +0,0 @@
|
|
1
|
-
require "helper"
|
2
|
-
|
3
|
-
class TestUserOrderFunctions < Test::Unit::TestCase
|
4
|
-
def test_order_with_balance
|
5
|
-
fake_request(:post, "/users/test_user/memes/1/order", :body => fixture("response/ok"), :content_type => "application/json")
|
6
|
-
authorize
|
7
|
-
assert_nothing_raised do
|
8
|
-
assert @im_client.order_with_balance(1)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_order_with_paypal
|
13
|
-
fake_request(:post, "/users/test_user/memes/1/order", :body => fixture("users/order_paypal"), :content_type => "application/json")
|
14
|
-
authorize
|
15
|
-
assert_nothing_raised do
|
16
|
-
assert_equal "test_paypal_url", @im_client.order_with_paypal(1)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_transactions
|
21
|
-
fake_request(:get, "/users/test_user/transactions?page=1&pageSize=25", :body => fixture("users/transactions"), :content_type => "application/json")
|
22
|
-
authorize
|
23
|
-
check_paged :transactions, @im_client.transactions(:page => 1, :pageSize => 25, :no_extract => true)
|
24
|
-
check_list :transactions, @im_client.transactions(:page => 1, :pageSize => 25)
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_invoices
|
28
|
-
fake_request(:get, "/users/test_user/invoices?page=1&pageSize=25", :body => fixture("users/invoices"), :content_type => "application/json")
|
29
|
-
authorize
|
30
|
-
check_paged :invoices, @im_client.invoices(:page => 1, :pageSize => 25, :no_extract => true)
|
31
|
-
check_list :invoices, @im_client.invoices(:page => 1, :pageSize => 25)
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_invoice
|
35
|
-
fake_request(:get, "/users/test_user/invoices/1", :body => fixture("users/invoice"), :content_type => "application/json")
|
36
|
-
authorize
|
37
|
-
invoice = @im_client.invoice(1)
|
38
|
-
check_eh :invoice, invoice
|
39
|
-
assert_respond_to invoice, :amount_user
|
40
|
-
assert_equal 10.0, invoice.amount_user
|
41
|
-
assert_respond_to invoice, :meme
|
42
|
-
assert_respond_to invoice.meme, :name
|
43
|
-
assert_equal "test meme 1", invoice.meme.name
|
44
|
-
end
|
45
|
-
end
|