spec/wallet_spec.rb in freee-0.0.2 vs spec/wallet_spec.rb in freee-0.0.3
- old
+ new
@@ -2,15 +2,38 @@
describe Freee::Wallet do
let(:client_id) { get_client_id }
let(:secret_key) { get_secret_key }
let(:token) { get_token }
- let(:wallet) { Freee::Wallet.new }
+ let(:company_id) { get_company_id }
+ let(:wallet) { Freee::Wallet }
before(:each) do
- Freee::Base.config(config_id, secret_key, token)
+ Freee::Base.config(client_id, secret_key, token)
end
it 'should can be able to create instance' do
- expect(wallet.list).not_to be_nil
+ expect(wallet.list(company_id)).not_to be_nil
+ end
+
+ describe 'should get information of wallet txns for the company' do
+ subject { wallet.list(company_id) }
+
+ it { is_expected.to include('wallet_txns') }
+ end
+
+ describe 'should get information of first wallet txns for the company' do
+ subject { wallet.list(company_id)['wallet_txns'].first }
+
+ it { is_expected.not_to be_nil }
+ it { is_expected.to include('id') }
+ it { is_expected.to include('company_id') }
+ it { is_expected.to include('amount') }
+ it { is_expected.to include('balance') }
+ it { is_expected.to include('description') }
+ it { is_expected.to include('due_amount') }
+ it { is_expected.to include('date') }
+ it { is_expected.to include('entry_side') }
+ it { is_expected.to include('walletable_type') }
+ it { is_expected.to include('walletable_id') }
end
end