-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Payjp | ||
class Balance < APIResource | ||
include Payjp::APIOperations::List | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Payjp | ||
class Term < APIResource | ||
include Payjp::APIOperations::List | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Payjp | ||
VERSION = '0.0.13' | ||
VERSION = '0.0.14' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require File.expand_path('../../test_helper', __FILE__) | ||
|
||
module Payjp | ||
class BalanceTest < Test::Unit::TestCase | ||
should "balances should be listable" do | ||
@mock.expects(:get).once.returns(test_response(test_balance_array)) | ||
c = Payjp::Balance.all.data | ||
assert c.is_a? Array | ||
assert c[0].is_a? Payjp::Balance | ||
end | ||
|
||
should "retrieve should retrieve balance" do | ||
@mock.expects(:get).once.returns(test_response(test_balance)) | ||
balance = Payjp::Balance.retrieve('ba_test_balance') | ||
assert_equal 'ba_test_balance', balance.id | ||
end | ||
|
||
should "balances should not be deletable" do | ||
assert_raises NoMethodError do | ||
@mock.expects(:get).once.returns(test_response(test_balance)) | ||
balance = Payjp::Balance.retrieve('ba_test_balance') | ||
balance.delete | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require File.expand_path('../../test_helper', __FILE__) | ||
|
||
module Payjp | ||
class TermTest < Test::Unit::TestCase | ||
should "terms should be listable" do | ||
@mock.expects(:get).once.returns(test_response(test_term_array)) | ||
c = Payjp::Term.all.data | ||
assert c.is_a? Array | ||
assert c[0].is_a? Payjp::Term | ||
end | ||
|
||
should "retrieve should retrieve term" do | ||
@mock.expects(:get).once.returns(test_response(test_term)) | ||
term = Payjp::Term.retrieve('tm_test_term') | ||
assert_equal 'tm_test_term', term.id | ||
end | ||
|
||
should "terms should not be deletable" do | ||
assert_raises NoMethodError do | ||
@mock.expects(:get).once.returns(test_response(test_term)) | ||
term = Payjp::Term.retrieve('tm_test_term') | ||
term.delete | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters