Sha256: 3c7961805dc46451b2c2f1340cad2cd814ad3c8489aa8b06b6a56401cb34502f

Contents?: true

Size: 1.34 KB

Versions: 14

Compression:

Stored size: 1.34 KB

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "spec_helper")

describe BillForward::CreditNote do
	before :all do
		@client = BillForwardTest::TEST_CLIENT
		BillForward::Client.default_client = @client
	end
	describe '::create' do
		context 'account exists' do
			context 'account has credit note payment method' do
				before :all do
					@created_account = BillForward::Account.create

					# account implicitly has these nowadays
					# payment_method = BillForward::PaymentMethod.new({
					# 	'accountID' => @created_account.id,
					# 	'name' => 'Credit Notes',
					# 	'description' => 'Pay using credit',
					# 	# engines will link this to an invoice once paid, for the sake of refunds
					# 	'linkID' => '',
					# 	'gateway' => 'credit_note',
					# 	'userEditable' => 0,
					# 	'priority' => 100,
					# 	'reusable' => 1
					# 	})
					# created_payment_method = BillForward::PaymentMethod::create(payment_method)
				end
				subject (:account) { @created_account }
				it 'issues credit' do
					credit_note = BillForward::CreditNote.new({
						"accountID" => account.id,
					    "value" => 15,
					    "currency" => "USD"
						})
					created_credit_note = BillForward::CreditNote.create(credit_note)

					expect(created_credit_note['@type']).to eq(BillForward::CreditNote.resource_path.entity_name)
				end
			end
		end
	end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bill_forward-2.2016.241 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-2.2016.227 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-2.2016.222 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-2.2016.209 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2016.117 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2016.101 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2016.26 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.321.1 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.321 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.299 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.217.1 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.217 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.186 spec/functional/bad_citizen/credit_note_spec.rb
bill_forward-1.2015.183 spec/functional/bad_citizen/credit_note_spec.rb