From 737491484ed34d03c88599efe723883f537b70f3 Mon Sep 17 00:00:00 2001 From: Jared King Date: Sun, 30 Jan 2022 21:55:43 -0600 Subject: [PATCH] Add more objects (#19) --- lib/invoiced.rb | 41 ++++++++++++++++++- lib/invoiced/custom_field.rb | 10 +++++ lib/invoiced/customer_chasing_cadence.rb | 10 +++++ lib/invoiced/email_template.rb | 10 +++++ lib/invoiced/gl_account.rb | 10 +++++ lib/invoiced/inbox.rb | 7 ++++ lib/invoiced/invoice_chasing_cadence.rb | 10 +++++ lib/invoiced/late_fee_schedule.rb | 10 +++++ lib/invoiced/member.rb | 10 +++++ lib/invoiced/merchant_account.rb | 10 +++++ lib/invoiced/object.rb | 6 ++- lib/invoiced/payment_method.rb | 8 ++++ lib/invoiced/pdf_template.rb | 10 +++++ lib/invoiced/report.rb | 7 ++++ lib/invoiced/role.rb | 10 +++++ lib/invoiced/sign_up_page.rb | 10 +++++ lib/invoiced/sms_template.rb | 10 +++++ lib/invoiced/tax_rule.rb | 10 +++++ lib/invoiced/theme.rb | 10 +++++ lib/invoiced/webhook.rb | 10 +++++ test/invoiced/custom_field_test.rb | 17 ++++++++ .../invoiced/customer_chasing_cadence_test.rb | 17 ++++++++ test/invoiced/email_template_test.rb | 17 ++++++++ test/invoiced/gl_account_test.rb | 17 ++++++++ test/invoiced/inbox_test.rb | 13 ++++++ test/invoiced/invoice_chasing_cadence_test.rb | 17 ++++++++ test/invoiced/late_fee_schedule_test.rb | 17 ++++++++ test/invoiced/member_test.rb | 17 ++++++++ test/invoiced/merchant_account_test.rb | 17 ++++++++ test/invoiced/payment_method_test.rb | 15 +++++++ test/invoiced/pdf_template_test.rb | 17 ++++++++ test/invoiced/report_test.rb | 14 +++++++ test/invoiced/role_test.rb | 17 ++++++++ test/invoiced/sign_up_page_test.rb | 17 ++++++++ test/invoiced/sms_template_test.rb | 17 ++++++++ test/invoiced/tax_rule_test.rb | 17 ++++++++ test/invoiced/theme_test.rb | 17 ++++++++ test/invoiced/webhook_test.rb | 17 ++++++++ 38 files changed, 513 insertions(+), 3 deletions(-) create mode 100644 lib/invoiced/custom_field.rb create mode 100644 lib/invoiced/customer_chasing_cadence.rb create mode 100644 lib/invoiced/email_template.rb create mode 100644 lib/invoiced/gl_account.rb create mode 100644 lib/invoiced/inbox.rb create mode 100644 lib/invoiced/invoice_chasing_cadence.rb create mode 100644 lib/invoiced/late_fee_schedule.rb create mode 100644 lib/invoiced/member.rb create mode 100644 lib/invoiced/merchant_account.rb create mode 100644 lib/invoiced/payment_method.rb create mode 100644 lib/invoiced/pdf_template.rb create mode 100644 lib/invoiced/report.rb create mode 100644 lib/invoiced/role.rb create mode 100644 lib/invoiced/sign_up_page.rb create mode 100644 lib/invoiced/sms_template.rb create mode 100644 lib/invoiced/tax_rule.rb create mode 100644 lib/invoiced/theme.rb create mode 100644 lib/invoiced/webhook.rb create mode 100644 test/invoiced/custom_field_test.rb create mode 100644 test/invoiced/customer_chasing_cadence_test.rb create mode 100644 test/invoiced/email_template_test.rb create mode 100644 test/invoiced/gl_account_test.rb create mode 100644 test/invoiced/inbox_test.rb create mode 100644 test/invoiced/invoice_chasing_cadence_test.rb create mode 100644 test/invoiced/late_fee_schedule_test.rb create mode 100644 test/invoiced/member_test.rb create mode 100644 test/invoiced/merchant_account_test.rb create mode 100644 test/invoiced/payment_method_test.rb create mode 100644 test/invoiced/pdf_template_test.rb create mode 100644 test/invoiced/report_test.rb create mode 100644 test/invoiced/role_test.rb create mode 100644 test/invoiced/sign_up_page_test.rb create mode 100644 test/invoiced/sms_template_test.rb create mode 100644 test/invoiced/tax_rule_test.rb create mode 100644 test/invoiced/theme_test.rb create mode 100644 test/invoiced/webhook_test.rb diff --git a/lib/invoiced.rb b/lib/invoiced.rb index 7d05574..3acb6d7 100644 --- a/lib/invoiced.rb +++ b/lib/invoiced.rb @@ -19,6 +19,7 @@ require 'invoiced/object' require 'invoiced/payment_source_object' + require 'invoiced/attachment' require 'invoiced/bank_account' require 'invoiced/card' @@ -27,25 +28,43 @@ require 'invoiced/coupon' require 'invoiced/credit_balance_adjustment' require 'invoiced/credit_note' +require 'invoiced/custom_field' require 'invoiced/customer' +require 'invoiced/customer_chasing_cadence' require 'invoiced/email' +require 'invoiced/email_template' require 'invoiced/estimate' require 'invoiced/event' require 'invoiced/file' +require 'invoiced/gl_account' +require 'invoiced/inbox' require 'invoiced/invoice' +require 'invoiced/invoice_chasing_cadence' require 'invoiced/item' +require 'invoiced/late_fee_schedule' require 'invoiced/letter' require 'invoiced/line_item' +require 'invoiced/member' +require 'invoiced/merchant_account' require 'invoiced/note' require 'invoiced/payment' +require 'invoiced/payment_method' require 'invoiced/payment_plan' require 'invoiced/payment_source' +require 'invoiced/pdf_template' require 'invoiced/plan' require 'invoiced/refund' +require 'invoiced/report' +require 'invoiced/role' +require 'invoiced/sign_up_page' +require 'invoiced/sms_template' require 'invoiced/subscription' require 'invoiced/task' require 'invoiced/tax_rate' +require 'invoiced/tax_rule' require 'invoiced/text_message' +require 'invoiced/theme' +require 'invoiced/webhook' module Invoiced class Client @@ -56,7 +75,7 @@ class Client ReadTimeout = 80 attr_reader :api_key, :api_url, :sandbox, :sso_key - attr_reader :Item, :Charge, :Coupon, :CreditBalanceAdjustment, :CreditNote, :Customer, :Estimate, :Event, :File, :Invoice, :Note, :Payment, :Plan, :Refund, :Subscription, :Task, :TaxRate + attr_reader :Charge, :Coupon, :CreditBalanceAdjustment, :CreditNote, :CustomField, :Customer, :CustomerChasingCadence, :EmailTemplate, :Estimate, :Event, :File, :GlAccount, :Inbox, :Invoice, :InvoiceChasingCadence, :Item, :LateFeeSchedule, :Member, :MerchantAccount, :Note, :Payment, :PaymentMethod, :PdfTemplate, :Plan, :Refund, :Report, :Role, :SignUpPage, :SmsTemplate, :Subscription, :Task, :TaxRate, :TaxRule, :Theme, :Webhook def initialize(api_key, sandbox=false, sso_key=false) @api_key = api_key @@ -65,23 +84,41 @@ def initialize(api_key, sandbox=false, sso_key=false) @sso_key = sso_key # Object endpoints - @Item = Invoiced::Item.new(self) @Charge = Invoiced::Charge.new(self) @Coupon = Invoiced::Coupon.new(self) @CreditBalanceAdjustment = Invoiced::CreditBalanceAdjustment.new(self) @CreditNote = Invoiced::CreditNote.new(self) + @CustomField = Invoiced::CustomField.new(self) @Customer = Invoiced::Customer.new(self) + @CustomerChasingCadence = Invoiced::CustomerChasingCadence.new(self) + @EmailTemplate = Invoiced::EmailTemplate.new(self) @Estimate = Invoiced::Estimate.new(self) @Event = Invoiced::Event.new(self) @File = Invoiced::File.new(self) + @GlAccount = Invoiced::GlAccount.new(self) + @Inbox = Invoiced::Inbox.new(self) @Invoice = Invoiced::Invoice.new(self) + @InvoiceChasingCadence = Invoiced::InvoiceChasingCadence.new(self) + @Item = Invoiced::Item.new(self) + @LateFeeSchedule = Invoiced::LateFeeSchedule.new(self) + @Member = Invoiced::Member.new(self) + @MerchantAccount = Invoiced::MerchantAccount.new(self) @Note = Invoiced::Note.new(self) @Payment = Invoiced::Payment.new(self) + @PaymentMethod = Invoiced::PaymentMethod.new(self) + @PdfTemplate = Invoiced::PdfTemplate.new(self) @Plan = Invoiced::Plan.new(self) @Refund = Invoiced::Refund.new(self) + @Report = Invoiced::Report.new(self) + @Role = Invoiced::Role.new(self) + @SignUpPage = Invoiced::SignUpPage.new(self) + @SmsTemplate = Invoiced::SmsTemplate.new(self) @Subscription = Invoiced::Subscription.new(self) @Task = Invoiced::Task.new(self) @TaxRate = Invoiced::TaxRate.new(self) + @TaxRule = Invoiced::TaxRule.new(self) + @Theme = Invoiced::Theme.new(self) + @Webhook = Invoiced::Webhook.new(self) end def request(method, endpoint, params={}, opts={}) diff --git a/lib/invoiced/custom_field.rb b/lib/invoiced/custom_field.rb new file mode 100644 index 0000000..7f463f9 --- /dev/null +++ b/lib/invoiced/custom_field.rb @@ -0,0 +1,10 @@ +module Invoiced + class CustomField < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'custom_field' + end +end \ No newline at end of file diff --git a/lib/invoiced/customer_chasing_cadence.rb b/lib/invoiced/customer_chasing_cadence.rb new file mode 100644 index 0000000..cadb9d5 --- /dev/null +++ b/lib/invoiced/customer_chasing_cadence.rb @@ -0,0 +1,10 @@ +module Invoiced + class CustomerChasingCadence < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'customer_chasing_cadence' + end +end \ No newline at end of file diff --git a/lib/invoiced/email_template.rb b/lib/invoiced/email_template.rb new file mode 100644 index 0000000..2fcfa19 --- /dev/null +++ b/lib/invoiced/email_template.rb @@ -0,0 +1,10 @@ +module Invoiced + class EmailTemplate < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'email_template' + end +end \ No newline at end of file diff --git a/lib/invoiced/gl_account.rb b/lib/invoiced/gl_account.rb new file mode 100644 index 0000000..2539ff1 --- /dev/null +++ b/lib/invoiced/gl_account.rb @@ -0,0 +1,10 @@ +module Invoiced + class GlAccount < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'gl_account' + end +end \ No newline at end of file diff --git a/lib/invoiced/inbox.rb b/lib/invoiced/inbox.rb new file mode 100644 index 0000000..102ea32 --- /dev/null +++ b/lib/invoiced/inbox.rb @@ -0,0 +1,7 @@ +module Invoiced + class Inbox < Object + include Invoiced::Operations::List + + OBJECT_NAME = 'inbox' + end +end \ No newline at end of file diff --git a/lib/invoiced/invoice_chasing_cadence.rb b/lib/invoiced/invoice_chasing_cadence.rb new file mode 100644 index 0000000..4315a65 --- /dev/null +++ b/lib/invoiced/invoice_chasing_cadence.rb @@ -0,0 +1,10 @@ +module Invoiced + class InvoiceChasingCadence < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'invoice_chasing_cadence' + end +end \ No newline at end of file diff --git a/lib/invoiced/late_fee_schedule.rb b/lib/invoiced/late_fee_schedule.rb new file mode 100644 index 0000000..070511f --- /dev/null +++ b/lib/invoiced/late_fee_schedule.rb @@ -0,0 +1,10 @@ +module Invoiced + class LateFeeSchedule < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'late_fee_schedule' + end +end \ No newline at end of file diff --git a/lib/invoiced/member.rb b/lib/invoiced/member.rb new file mode 100644 index 0000000..da4f0ca --- /dev/null +++ b/lib/invoiced/member.rb @@ -0,0 +1,10 @@ +module Invoiced + class Member < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'member' + end +end \ No newline at end of file diff --git a/lib/invoiced/merchant_account.rb b/lib/invoiced/merchant_account.rb new file mode 100644 index 0000000..8489c4e --- /dev/null +++ b/lib/invoiced/merchant_account.rb @@ -0,0 +1,10 @@ +module Invoiced + class MerchantAccount < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'merchant_account' + end +end \ No newline at end of file diff --git a/lib/invoiced/object.rb b/lib/invoiced/object.rb index c29385f..fe8686c 100644 --- a/lib/invoiced/object.rb +++ b/lib/invoiced/object.rb @@ -35,7 +35,11 @@ def endpoint() def build_endpoint if self.class.const_defined? "OBJECT_NAME" - '/' + self.class::OBJECT_NAME + 's' + if self.class::OBJECT_NAME == 'inbox' + '/inboxes' + else + '/' + self.class::OBJECT_NAME + 's' + end else '/objects' end diff --git a/lib/invoiced/payment_method.rb b/lib/invoiced/payment_method.rb new file mode 100644 index 0000000..e945ab4 --- /dev/null +++ b/lib/invoiced/payment_method.rb @@ -0,0 +1,8 @@ +module Invoiced + class PaymentMethod < Object + include Invoiced::Operations::List + include Invoiced::Operations::Update + + OBJECT_NAME = 'payment_method' + end +end \ No newline at end of file diff --git a/lib/invoiced/pdf_template.rb b/lib/invoiced/pdf_template.rb new file mode 100644 index 0000000..0cc8e61 --- /dev/null +++ b/lib/invoiced/pdf_template.rb @@ -0,0 +1,10 @@ +module Invoiced + class PdfTemplate < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'pdf_template' + end +end \ No newline at end of file diff --git a/lib/invoiced/report.rb b/lib/invoiced/report.rb new file mode 100644 index 0000000..64b7721 --- /dev/null +++ b/lib/invoiced/report.rb @@ -0,0 +1,7 @@ +module Invoiced + class Report < Object + include Invoiced::Operations::Create + + OBJECT_NAME = 'report' + end +end \ No newline at end of file diff --git a/lib/invoiced/role.rb b/lib/invoiced/role.rb new file mode 100644 index 0000000..270b4ec --- /dev/null +++ b/lib/invoiced/role.rb @@ -0,0 +1,10 @@ +module Invoiced + class Role < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'role' + end +end \ No newline at end of file diff --git a/lib/invoiced/sign_up_page.rb b/lib/invoiced/sign_up_page.rb new file mode 100644 index 0000000..125e120 --- /dev/null +++ b/lib/invoiced/sign_up_page.rb @@ -0,0 +1,10 @@ +module Invoiced + class SignUpPage < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'sign_up_page' + end +end \ No newline at end of file diff --git a/lib/invoiced/sms_template.rb b/lib/invoiced/sms_template.rb new file mode 100644 index 0000000..4bc3d8e --- /dev/null +++ b/lib/invoiced/sms_template.rb @@ -0,0 +1,10 @@ +module Invoiced + class SmsTemplate < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'sms_template' + end +end \ No newline at end of file diff --git a/lib/invoiced/tax_rule.rb b/lib/invoiced/tax_rule.rb new file mode 100644 index 0000000..119be41 --- /dev/null +++ b/lib/invoiced/tax_rule.rb @@ -0,0 +1,10 @@ +module Invoiced + class TaxRule < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'tax_rule' + end +end \ No newline at end of file diff --git a/lib/invoiced/theme.rb b/lib/invoiced/theme.rb new file mode 100644 index 0000000..fc193ee --- /dev/null +++ b/lib/invoiced/theme.rb @@ -0,0 +1,10 @@ +module Invoiced + class Theme < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'theme' + end +end \ No newline at end of file diff --git a/lib/invoiced/webhook.rb b/lib/invoiced/webhook.rb new file mode 100644 index 0000000..3965623 --- /dev/null +++ b/lib/invoiced/webhook.rb @@ -0,0 +1,10 @@ +module Invoiced + class Webhook < Object + include Invoiced::Operations::List + include Invoiced::Operations::Create + include Invoiced::Operations::Update + include Invoiced::Operations::Delete + + OBJECT_NAME = 'webhook' + end +end \ No newline at end of file diff --git a/test/invoiced/custom_field_test.rb b/test/invoiced/custom_field_test.rb new file mode 100644 index 0000000..bf27273 --- /dev/null +++ b/test/invoiced/custom_field_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class CustomFieldTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = CustomField + @endpoint = '/custom_fields' + end + end +end \ No newline at end of file diff --git a/test/invoiced/customer_chasing_cadence_test.rb b/test/invoiced/customer_chasing_cadence_test.rb new file mode 100644 index 0000000..ca09cbb --- /dev/null +++ b/test/invoiced/customer_chasing_cadence_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class CustomerChasingCadenceTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = CustomerChasingCadence + @endpoint = '/customer_chasing_cadences' + end + end +end \ No newline at end of file diff --git a/test/invoiced/email_template_test.rb b/test/invoiced/email_template_test.rb new file mode 100644 index 0000000..0111af3 --- /dev/null +++ b/test/invoiced/email_template_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class EmailTemplateTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = EmailTemplate + @endpoint = '/email_templates' + end + end +end \ No newline at end of file diff --git a/test/invoiced/gl_account_test.rb b/test/invoiced/gl_account_test.rb new file mode 100644 index 0000000..41271c7 --- /dev/null +++ b/test/invoiced/gl_account_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class GlAccountTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = GlAccount + @endpoint = '/gl_accounts' + end + end +end \ No newline at end of file diff --git a/test/invoiced/inbox_test.rb b/test/invoiced/inbox_test.rb new file mode 100644 index 0000000..220dda8 --- /dev/null +++ b/test/invoiced/inbox_test.rb @@ -0,0 +1,13 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class InboxTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = Inbox + @endpoint = '/inboxes' + end + end +end \ No newline at end of file diff --git a/test/invoiced/invoice_chasing_cadence_test.rb b/test/invoiced/invoice_chasing_cadence_test.rb new file mode 100644 index 0000000..699d268 --- /dev/null +++ b/test/invoiced/invoice_chasing_cadence_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class InvoiceChasingCadenceTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = InvoiceChasingCadence + @endpoint = '/invoice_chasing_cadences' + end + end +end \ No newline at end of file diff --git a/test/invoiced/late_fee_schedule_test.rb b/test/invoiced/late_fee_schedule_test.rb new file mode 100644 index 0000000..f83f289 --- /dev/null +++ b/test/invoiced/late_fee_schedule_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class LateFeeScheduleTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = LateFeeSchedule + @endpoint = '/late_fee_schedules' + end + end +end \ No newline at end of file diff --git a/test/invoiced/member_test.rb b/test/invoiced/member_test.rb new file mode 100644 index 0000000..173103a --- /dev/null +++ b/test/invoiced/member_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class MemberTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = Member + @endpoint = '/members' + end + end +end \ No newline at end of file diff --git a/test/invoiced/merchant_account_test.rb b/test/invoiced/merchant_account_test.rb new file mode 100644 index 0000000..41245a0 --- /dev/null +++ b/test/invoiced/merchant_account_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class MerchantAccountTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = MerchantAccount + @endpoint = '/merchant_accounts' + end + end +end \ No newline at end of file diff --git a/test/invoiced/payment_method_test.rb b/test/invoiced/payment_method_test.rb new file mode 100644 index 0000000..d7e97c3 --- /dev/null +++ b/test/invoiced/payment_method_test.rb @@ -0,0 +1,15 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class PaymentMethodTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = PaymentMethod + @endpoint = '/payment_methods' + end + end +end \ No newline at end of file diff --git a/test/invoiced/pdf_template_test.rb b/test/invoiced/pdf_template_test.rb new file mode 100644 index 0000000..5b0889d --- /dev/null +++ b/test/invoiced/pdf_template_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class PdfTemplateTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = PdfTemplate + @endpoint = '/pdf_templates' + end + end +end \ No newline at end of file diff --git a/test/invoiced/report_test.rb b/test/invoiced/report_test.rb new file mode 100644 index 0000000..e91e5c1 --- /dev/null +++ b/test/invoiced/report_test.rb @@ -0,0 +1,14 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class ReportTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + + setup do + @objectClass = Report + @endpoint = '/reports' + end + end +end \ No newline at end of file diff --git a/test/invoiced/role_test.rb b/test/invoiced/role_test.rb new file mode 100644 index 0000000..ad2ce24 --- /dev/null +++ b/test/invoiced/role_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class RoleTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = Role + @endpoint = '/roles' + end + end +end \ No newline at end of file diff --git a/test/invoiced/sign_up_page_test.rb b/test/invoiced/sign_up_page_test.rb new file mode 100644 index 0000000..1d4017f --- /dev/null +++ b/test/invoiced/sign_up_page_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class SignUpPageTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = SignUpPage + @endpoint = '/sign_up_pages' + end + end +end \ No newline at end of file diff --git a/test/invoiced/sms_template_test.rb b/test/invoiced/sms_template_test.rb new file mode 100644 index 0000000..0926161 --- /dev/null +++ b/test/invoiced/sms_template_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class SmsTemplateTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = SmsTemplate + @endpoint = '/sms_templates' + end + end +end \ No newline at end of file diff --git a/test/invoiced/tax_rule_test.rb b/test/invoiced/tax_rule_test.rb new file mode 100644 index 0000000..503bbc4 --- /dev/null +++ b/test/invoiced/tax_rule_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class TaxRuleTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = TaxRule + @endpoint = '/tax_rules' + end + end +end \ No newline at end of file diff --git a/test/invoiced/theme_test.rb b/test/invoiced/theme_test.rb new file mode 100644 index 0000000..39886e4 --- /dev/null +++ b/test/invoiced/theme_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class ThemeTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = Theme + @endpoint = '/themes' + end + end +end \ No newline at end of file diff --git a/test/invoiced/webhook_test.rb b/test/invoiced/webhook_test.rb new file mode 100644 index 0000000..4832b74 --- /dev/null +++ b/test/invoiced/webhook_test.rb @@ -0,0 +1,17 @@ +require File.expand_path('../../test_helper', __FILE__) + +module Invoiced + class WebhookTest < Test::Unit::TestCase + include Invoiced::Operations::EndpointTest + include Invoiced::Operations::CreateTest + include Invoiced::Operations::RetrieveTest + include Invoiced::Operations::UpdateTest + include Invoiced::Operations::DeleteTest + include Invoiced::Operations::ListTest + + setup do + @objectClass = Webhook + @endpoint = '/webhooks' + end + end +end \ No newline at end of file