order_cloud 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +476 -0
- data/Rakefile +31 -0
- data/docs/AccessToken.md +10 -0
- data/docs/Address.md +20 -0
- data/docs/AddressApi.md +520 -0
- data/docs/AddressAssignment.md +12 -0
- data/docs/AdminAddressApi.md +324 -0
- data/docs/AdminCompany.md +10 -0
- data/docs/AdminModelOnView.md +7 -0
- data/docs/AdminUserApi.md +323 -0
- data/docs/ApprovalRule.md +20 -0
- data/docs/ApprovalRuleApi.md +342 -0
- data/docs/BaseSpec.md +15 -0
- data/docs/Buyer.md +11 -0
- data/docs/BuyerAddress.md +11 -0
- data/docs/BuyerApi.md +324 -0
- data/docs/BuyerCreditCard.md +9 -0
- data/docs/BuyerProduct.md +9 -0
- data/docs/BuyerSpec.md +9 -0
- data/docs/Category.md +15 -0
- data/docs/CategoryApi.md +684 -0
- data/docs/CategoryAssignment.md +10 -0
- data/docs/CategoryProductAssignment.md +10 -0
- data/docs/CostCenter.md +11 -0
- data/docs/CostCenterApi.md +516 -0
- data/docs/CostCenterAssignment.md +10 -0
- data/docs/CreditCard.md +15 -0
- data/docs/CreditCardApi.md +516 -0
- data/docs/CreditCardAssignment.md +10 -0
- data/docs/EmailTemplate.md +12 -0
- data/docs/EmailTemplateApi.md +223 -0
- data/docs/File.md +10 -0
- data/docs/FileApi.md +162 -0
- data/docs/ImpersonateTokenRequest.md +9 -0
- data/docs/Inventory.md +12 -0
- data/docs/LineItem.md +23 -0
- data/docs/LineItemApi.md +478 -0
- data/docs/LineItemSpec.md +11 -0
- data/docs/ListAddress.md +9 -0
- data/docs/ListAddressAssignment.md +9 -0
- data/docs/ListAdminCompany.md +9 -0
- data/docs/ListApiClient.md +9 -0
- data/docs/ListApprovalRule.md +9 -0
- data/docs/ListBuyer.md +9 -0
- data/docs/ListBuyerAddress.md +9 -0
- data/docs/ListBuyerCreditCard.md +9 -0
- data/docs/ListBuyerProduct.md +9 -0
- data/docs/ListBuyerSpec.md +9 -0
- data/docs/ListCategory.md +9 -0
- data/docs/ListCategoryAssignment.md +9 -0
- data/docs/ListCategoryProductAssignment.md +9 -0
- data/docs/ListCostCenter.md +9 -0
- data/docs/ListCostCenterAssignment.md +9 -0
- data/docs/ListCreditCard.md +9 -0
- data/docs/ListCreditCardAssignment.md +9 -0
- data/docs/ListDevAccessibleCompany.md +9 -0
- data/docs/ListFile.md +9 -0
- data/docs/ListInventory.md +9 -0
- data/docs/ListLineItem.md +9 -0
- data/docs/ListOrder.md +9 -0
- data/docs/ListOrderApproval.md +9 -0
- data/docs/ListOrderPromotion.md +9 -0
- data/docs/ListPayment.md +9 -0
- data/docs/ListPriceSchedule.md +9 -0
- data/docs/ListProduct.md +9 -0
- data/docs/ListProductAssignment.md +9 -0
- data/docs/ListPromotion.md +9 -0
- data/docs/ListPromotionAssignment.md +9 -0
- data/docs/ListSecurityProfile.md +9 -0
- data/docs/ListSecurityProfileAssignment.md +9 -0
- data/docs/ListShipment.md +9 -0
- data/docs/ListSpec.md +9 -0
- data/docs/ListSpecOption.md +9 -0
- data/docs/ListSpecProductAssignment.md +9 -0
- data/docs/ListSpendingAccount.md +9 -0
- data/docs/ListSpendingAccountAssignment.md +9 -0
- data/docs/ListUser.md +9 -0
- data/docs/ListUserGroup.md +9 -0
- data/docs/ListUserGroupAssignment.md +9 -0
- data/docs/ListVariant.md +9 -0
- data/docs/ListWebHook.md +9 -0
- data/docs/ListWebHookRoute.md +9 -0
- data/docs/ListXpIndex.md +9 -0
- data/docs/MeApi.md +1488 -0
- data/docs/Meta.md +12 -0
- data/docs/Order.md +31 -0
- data/docs/OrderApi.md +1277 -0
- data/docs/OrderApproval.md +16 -0
- data/docs/OrderPromotion.md +8 -0
- data/docs/PasswordReset.md +10 -0
- data/docs/PasswordResetApi.md +109 -0
- data/docs/PasswordResetRequest.md +11 -0
- data/docs/Payment.md +16 -0
- data/docs/PaymentApi.md +601 -0
- data/docs/PaymentTransaction.md +15 -0
- data/docs/PingResponse.md +8 -0
- data/docs/PriceBreak.md +9 -0
- data/docs/PriceSchedule.md +18 -0
- data/docs/PriceScheduleApi.md +429 -0
- data/docs/Product.md +22 -0
- data/docs/ProductApi.md +1115 -0
- data/docs/ProductAssignment.md +13 -0
- data/docs/Promotion.md +21 -0
- data/docs/PromotionApi.md +495 -0
- data/docs/PromotionAssignment.md +11 -0
- data/docs/SecurityProfile.md +11 -0
- data/docs/SecurityProfileApi.md +290 -0
- data/docs/SecurityProfileAssignment.md +11 -0
- data/docs/Shipment.md +14 -0
- data/docs/ShipmentApi.md +459 -0
- data/docs/ShipmentItem.md +10 -0
- data/docs/Spec.md +8 -0
- data/docs/SpecApi.md +816 -0
- data/docs/SpecOption.md +14 -0
- data/docs/SpecProductAssignment.md +10 -0
- data/docs/SpendingAccount.md +15 -0
- data/docs/SpendingAccountApi.md +516 -0
- data/docs/SpendingAccountAssignment.md +11 -0
- data/docs/User.md +17 -0
- data/docs/UserApi.md +399 -0
- data/docs/UserGroup.md +11 -0
- data/docs/UserGroupApi.md +508 -0
- data/docs/UserGroupAssignment.md +9 -0
- data/docs/Variant.md +12 -0
- data/docs/WebHook.md +18 -0
- data/docs/WebHookRoute.md +10 -0
- data/docs/XpIndex.md +9 -0
- data/git_push.sh +67 -0
- data/lib/order_cloud.rb +176 -0
- data/lib/order_cloud/api/address_api.rb +628 -0
- data/lib/order_cloud/api/admin_address_api.rb +397 -0
- data/lib/order_cloud/api/admin_user_api.rb +396 -0
- data/lib/order_cloud/api/approval_rule_api.rb +421 -0
- data/lib/order_cloud/api/buyer_api.rb +397 -0
- data/lib/order_cloud/api/category_api.rb +817 -0
- data/lib/order_cloud/api/cost_center_api.rb +622 -0
- data/lib/order_cloud/api/credit_card_api.rb +622 -0
- data/lib/order_cloud/api/email_template_api.rb +283 -0
- data/lib/order_cloud/api/file_api.rb +206 -0
- data/lib/order_cloud/api/line_item_api.rb +583 -0
- data/lib/order_cloud/api/me_api.rb +1747 -0
- data/lib/order_cloud/api/order_api.rb +1509 -0
- data/lib/order_cloud/api/password_reset_api.rb +150 -0
- data/lib/order_cloud/api/payment_api.rb +728 -0
- data/lib/order_cloud/api/price_schedule_api.rb +519 -0
- data/lib/order_cloud/api/product_api.rb +1311 -0
- data/lib/order_cloud/api/promotion_api.rb +596 -0
- data/lib/order_cloud/api/security_profile_api.rb +361 -0
- data/lib/order_cloud/api/shipment_api.rb +558 -0
- data/lib/order_cloud/api/spec_api.rb +965 -0
- data/lib/order_cloud/api/spending_account_api.rb +622 -0
- data/lib/order_cloud/api/user_api.rb +488 -0
- data/lib/order_cloud/api/user_group_api.rb +613 -0
- data/lib/order_cloud/api_auth.rb +99 -0
- data/lib/order_cloud/api_client.rb +385 -0
- data/lib/order_cloud/api_error.rb +47 -0
- data/lib/order_cloud/configuration.rb +244 -0
- data/lib/order_cloud/models/access_token.rb +217 -0
- data/lib/order_cloud/models/address.rb +307 -0
- data/lib/order_cloud/models/address_assignment.rb +235 -0
- data/lib/order_cloud/models/admin_company.rb +217 -0
- data/lib/order_cloud/models/admin_model_on_view.rb +190 -0
- data/lib/order_cloud/models/approval_rule.rb +307 -0
- data/lib/order_cloud/models/base_spec.rb +262 -0
- data/lib/order_cloud/models/buyer.rb +226 -0
- data/lib/order_cloud/models/buyer_address.rb +226 -0
- data/lib/order_cloud/models/buyer_credit_card.rb +208 -0
- data/lib/order_cloud/models/buyer_product.rb +208 -0
- data/lib/order_cloud/models/buyer_spec.rb +210 -0
- data/lib/order_cloud/models/category.rb +262 -0
- data/lib/order_cloud/models/category_assignment.rb +217 -0
- data/lib/order_cloud/models/category_product_assignment.rb +217 -0
- data/lib/order_cloud/models/cost_center.rb +226 -0
- data/lib/order_cloud/models/cost_center_assignment.rb +217 -0
- data/lib/order_cloud/models/credit_card.rb +262 -0
- data/lib/order_cloud/models/credit_card_assignment.rb +217 -0
- data/lib/order_cloud/models/email_template.rb +235 -0
- data/lib/order_cloud/models/file.rb +217 -0
- data/lib/order_cloud/models/impersonate_token_request.rb +208 -0
- data/lib/order_cloud/models/inventory.rb +235 -0
- data/lib/order_cloud/models/line_item.rb +336 -0
- data/lib/order_cloud/models/line_item_spec.rb +226 -0
- data/lib/order_cloud/models/list_address.rb +210 -0
- data/lib/order_cloud/models/list_address_assignment.rb +210 -0
- data/lib/order_cloud/models/list_admin_company.rb +210 -0
- data/lib/order_cloud/models/list_api_client.rb +210 -0
- data/lib/order_cloud/models/list_approval_rule.rb +210 -0
- data/lib/order_cloud/models/list_buyer.rb +210 -0
- data/lib/order_cloud/models/list_buyer_address.rb +210 -0
- data/lib/order_cloud/models/list_buyer_credit_card.rb +210 -0
- data/lib/order_cloud/models/list_buyer_product.rb +210 -0
- data/lib/order_cloud/models/list_buyer_spec.rb +210 -0
- data/lib/order_cloud/models/list_category.rb +210 -0
- data/lib/order_cloud/models/list_category_assignment.rb +210 -0
- data/lib/order_cloud/models/list_category_product_assignment.rb +210 -0
- data/lib/order_cloud/models/list_cost_center.rb +210 -0
- data/lib/order_cloud/models/list_cost_center_assignment.rb +210 -0
- data/lib/order_cloud/models/list_credit_card.rb +210 -0
- data/lib/order_cloud/models/list_credit_card_assignment.rb +210 -0
- data/lib/order_cloud/models/list_dev_accessible_company.rb +210 -0
- data/lib/order_cloud/models/list_file.rb +210 -0
- data/lib/order_cloud/models/list_inventory.rb +210 -0
- data/lib/order_cloud/models/list_line_item.rb +210 -0
- data/lib/order_cloud/models/list_order.rb +210 -0
- data/lib/order_cloud/models/list_order_approval.rb +210 -0
- data/lib/order_cloud/models/list_order_promotion.rb +210 -0
- data/lib/order_cloud/models/list_payment.rb +210 -0
- data/lib/order_cloud/models/list_price_schedule.rb +210 -0
- data/lib/order_cloud/models/list_product.rb +210 -0
- data/lib/order_cloud/models/list_product_assignment.rb +210 -0
- data/lib/order_cloud/models/list_promotion.rb +210 -0
- data/lib/order_cloud/models/list_promotion_assignment.rb +210 -0
- data/lib/order_cloud/models/list_security_profile.rb +210 -0
- data/lib/order_cloud/models/list_security_profile_assignment.rb +210 -0
- data/lib/order_cloud/models/list_shipment.rb +210 -0
- data/lib/order_cloud/models/list_spec.rb +210 -0
- data/lib/order_cloud/models/list_spec_option.rb +210 -0
- data/lib/order_cloud/models/list_spec_product_assignment.rb +210 -0
- data/lib/order_cloud/models/list_spending_account.rb +210 -0
- data/lib/order_cloud/models/list_spending_account_assignment.rb +210 -0
- data/lib/order_cloud/models/list_user.rb +210 -0
- data/lib/order_cloud/models/list_user_group.rb +210 -0
- data/lib/order_cloud/models/list_user_group_assignment.rb +210 -0
- data/lib/order_cloud/models/list_variant.rb +210 -0
- data/lib/order_cloud/models/list_web_hook.rb +210 -0
- data/lib/order_cloud/models/list_web_hook_route.rb +210 -0
- data/lib/order_cloud/models/list_xp_index.rb +210 -0
- data/lib/order_cloud/models/meta.rb +237 -0
- data/lib/order_cloud/models/order.rb +406 -0
- data/lib/order_cloud/models/order_approval.rb +271 -0
- data/lib/order_cloud/models/order_promotion.rb +199 -0
- data/lib/order_cloud/models/password_reset.rb +217 -0
- data/lib/order_cloud/models/password_reset_request.rb +226 -0
- data/lib/order_cloud/models/payment.rb +273 -0
- data/lib/order_cloud/models/payment_transaction.rb +262 -0
- data/lib/order_cloud/models/ping_response.rb +199 -0
- data/lib/order_cloud/models/price_break.rb +208 -0
- data/lib/order_cloud/models/price_schedule.rb +291 -0
- data/lib/order_cloud/models/product.rb +325 -0
- data/lib/order_cloud/models/product_assignment.rb +244 -0
- data/lib/order_cloud/models/promotion.rb +316 -0
- data/lib/order_cloud/models/promotion_assignment.rb +226 -0
- data/lib/order_cloud/models/security_profile.rb +228 -0
- data/lib/order_cloud/models/security_profile_assignment.rb +226 -0
- data/lib/order_cloud/models/shipment.rb +255 -0
- data/lib/order_cloud/models/shipment_item.rb +217 -0
- data/lib/order_cloud/models/spec.rb +199 -0
- data/lib/order_cloud/models/spec_option.rb +253 -0
- data/lib/order_cloud/models/spec_product_assignment.rb +217 -0
- data/lib/order_cloud/models/spending_account.rb +262 -0
- data/lib/order_cloud/models/spending_account_assignment.rb +226 -0
- data/lib/order_cloud/models/user.rb +280 -0
- data/lib/order_cloud/models/user_group.rb +226 -0
- data/lib/order_cloud/models/user_group_assignment.rb +208 -0
- data/lib/order_cloud/models/variant.rb +235 -0
- data/lib/order_cloud/models/web_hook.rb +289 -0
- data/lib/order_cloud/models/web_hook_route.rb +217 -0
- data/lib/order_cloud/models/xp_index.rb +208 -0
- data/lib/order_cloud/version.rb +26 -0
- data/order_cloud.gemspec +56 -0
- data/spec/api/address_api_spec.rb +179 -0
- data/spec/api/admin_address_api_spec.rb +125 -0
- data/spec/api/admin_user_api_spec.rb +125 -0
- data/spec/api/approval_rule_api_spec.rb +131 -0
- data/spec/api/buyer_api_spec.rb +125 -0
- data/spec/api/category_api_spec.rb +221 -0
- data/spec/api/cost_center_api_spec.rb +177 -0
- data/spec/api/credit_card_api_spec.rb +177 -0
- data/spec/api/email_template_api_spec.rb +100 -0
- data/spec/api/file_api_spec.rb +83 -0
- data/spec/api/line_item_api_spec.rb +167 -0
- data/spec/api/me_api_spec.rb +431 -0
- data/spec/api/order_api_spec.rb +375 -0
- data/spec/api/password_reset_api_spec.rb +71 -0
- data/spec/api/payment_api_spec.rb +199 -0
- data/spec/api/price_schedule_api_spec.rb +151 -0
- data/spec/api/product_api_spec.rb +330 -0
- data/spec/api/promotion_api_spec.rb +170 -0
- data/spec/api/security_profile_api_spec.rb +120 -0
- data/spec/api/shipment_api_spec.rb +161 -0
- data/spec/api/spec_api_spec.rb +250 -0
- data/spec/api/spending_account_api_spec.rb +177 -0
- data/spec/api/user_api_spec.rb +146 -0
- data/spec/api/user_group_api_spec.rb +174 -0
- data/spec/api_auth_spec.rb +165 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +80 -0
- data/spec/models/access_token_spec.rb +65 -0
- data/spec/models/address_assignment_spec.rb +77 -0
- data/spec/models/address_spec.rb +125 -0
- data/spec/models/admin_company_spec.rb +65 -0
- data/spec/models/admin_model_on_view_spec.rb +47 -0
- data/spec/models/approval_rule_spec.rb +125 -0
- data/spec/models/base_spec_spec.rb +95 -0
- data/spec/models/buyer_address_spec.rb +71 -0
- data/spec/models/buyer_credit_card_spec.rb +59 -0
- data/spec/models/buyer_product_spec.rb +59 -0
- data/spec/models/buyer_spec.rb +71 -0
- data/spec/models/buyer_spec_spec.rb +59 -0
- data/spec/models/category_assignment_spec.rb +65 -0
- data/spec/models/category_product_assignment_spec.rb +65 -0
- data/spec/models/category_spec.rb +95 -0
- data/spec/models/cost_center_assignment_spec.rb +65 -0
- data/spec/models/cost_center_spec.rb +71 -0
- data/spec/models/credit_card_assignment_spec.rb +65 -0
- data/spec/models/credit_card_spec.rb +95 -0
- data/spec/models/email_template_spec.rb +77 -0
- data/spec/models/file_spec.rb +65 -0
- data/spec/models/impersonate_token_request_spec.rb +59 -0
- data/spec/models/inventory_spec.rb +77 -0
- data/spec/models/line_item_spec.rb +143 -0
- data/spec/models/line_item_spec_spec.rb +71 -0
- data/spec/models/list_address_assignment_spec.rb +59 -0
- data/spec/models/list_address_spec.rb +59 -0
- data/spec/models/list_admin_company_spec.rb +59 -0
- data/spec/models/list_api_client_spec.rb +59 -0
- data/spec/models/list_approval_rule_spec.rb +59 -0
- data/spec/models/list_buyer_address_spec.rb +59 -0
- data/spec/models/list_buyer_credit_card_spec.rb +59 -0
- data/spec/models/list_buyer_product_spec.rb +59 -0
- data/spec/models/list_buyer_spec.rb +59 -0
- data/spec/models/list_buyer_spec_spec.rb +59 -0
- data/spec/models/list_category_assignment_spec.rb +59 -0
- data/spec/models/list_category_product_assignment_spec.rb +59 -0
- data/spec/models/list_category_spec.rb +59 -0
- data/spec/models/list_cost_center_assignment_spec.rb +59 -0
- data/spec/models/list_cost_center_spec.rb +59 -0
- data/spec/models/list_credit_card_assignment_spec.rb +59 -0
- data/spec/models/list_credit_card_spec.rb +59 -0
- data/spec/models/list_dev_accessible_company_spec.rb +59 -0
- data/spec/models/list_file_spec.rb +59 -0
- data/spec/models/list_inventory_spec.rb +59 -0
- data/spec/models/list_line_item_spec.rb +59 -0
- data/spec/models/list_order_approval_spec.rb +59 -0
- data/spec/models/list_order_promotion_spec.rb +59 -0
- data/spec/models/list_order_spec.rb +59 -0
- data/spec/models/list_payment_spec.rb +59 -0
- data/spec/models/list_price_schedule_spec.rb +59 -0
- data/spec/models/list_product_assignment_spec.rb +59 -0
- data/spec/models/list_product_spec.rb +59 -0
- data/spec/models/list_promotion_assignment_spec.rb +59 -0
- data/spec/models/list_promotion_spec.rb +59 -0
- data/spec/models/list_security_profile_assignment_spec.rb +59 -0
- data/spec/models/list_security_profile_spec.rb +59 -0
- data/spec/models/list_shipment_spec.rb +59 -0
- data/spec/models/list_spec_option_spec.rb +59 -0
- data/spec/models/list_spec_product_assignment_spec.rb +59 -0
- data/spec/models/list_spec_spec.rb +59 -0
- data/spec/models/list_spending_account_assignment_spec.rb +59 -0
- data/spec/models/list_spending_account_spec.rb +59 -0
- data/spec/models/list_user_group_assignment_spec.rb +59 -0
- data/spec/models/list_user_group_spec.rb +59 -0
- data/spec/models/list_user_spec.rb +59 -0
- data/spec/models/list_variant_spec.rb +59 -0
- data/spec/models/list_web_hook_route_spec.rb +59 -0
- data/spec/models/list_web_hook_spec.rb +59 -0
- data/spec/models/list_xp_index_spec.rb +59 -0
- data/spec/models/meta_spec.rb +77 -0
- data/spec/models/order_approval_spec.rb +101 -0
- data/spec/models/order_promotion_spec.rb +53 -0
- data/spec/models/order_spec.rb +191 -0
- data/spec/models/password_reset_request_spec.rb +71 -0
- data/spec/models/password_reset_spec.rb +65 -0
- data/spec/models/payment_spec.rb +101 -0
- data/spec/models/payment_transaction_spec.rb +95 -0
- data/spec/models/ping_response_spec.rb +53 -0
- data/spec/models/price_break_spec.rb +59 -0
- data/spec/models/price_schedule_spec.rb +113 -0
- data/spec/models/product_assignment_spec.rb +83 -0
- data/spec/models/product_spec.rb +137 -0
- data/spec/models/promotion_assignment_spec.rb +71 -0
- data/spec/models/promotion_spec.rb +131 -0
- data/spec/models/security_profile_assignment_spec.rb +71 -0
- data/spec/models/security_profile_spec.rb +71 -0
- data/spec/models/shipment_item_spec.rb +65 -0
- data/spec/models/shipment_spec.rb +89 -0
- data/spec/models/spec_option_spec.rb +89 -0
- data/spec/models/spec_product_assignment_spec.rb +65 -0
- data/spec/models/spec_spec.rb +53 -0
- data/spec/models/spending_account_assignment_spec.rb +71 -0
- data/spec/models/spending_account_spec.rb +95 -0
- data/spec/models/user_group_assignment_spec.rb +59 -0
- data/spec/models/user_group_spec.rb +71 -0
- data/spec/models/user_spec.rb +107 -0
- data/spec/models/variant_spec.rb +77 -0
- data/spec/models/web_hook_route_spec.rb +65 -0
- data/spec/models/web_hook_spec.rb +113 -0
- data/spec/models/xp_index_spec.rb +59 -0
- data/spec/spec_helper.rb +122 -0
- metadata +757 -0
@@ -0,0 +1,174 @@
|
|
1
|
+
=begin
|
2
|
+
#OrderCloud
|
3
|
+
|
4
|
+
#A full ecommerce backend as a service.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
Contact: ordercloud@four51.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'spec_helper'
|
25
|
+
require 'json'
|
26
|
+
|
27
|
+
# Unit tests for OrderCloud::UserGroupApi
|
28
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
29
|
+
# Please update as you see appropriate
|
30
|
+
describe 'UserGroupApi' do
|
31
|
+
before do
|
32
|
+
# run before each test
|
33
|
+
@instance = OrderCloud::UserGroupApi.new
|
34
|
+
end
|
35
|
+
|
36
|
+
after do
|
37
|
+
# run after each test
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'test an instance of UserGroupApi' do
|
41
|
+
it 'should create an instact of UserGroupApi' do
|
42
|
+
expect(@instance).to be_instance_of(OrderCloud::UserGroupApi)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# unit tests for create
|
47
|
+
#
|
48
|
+
#
|
49
|
+
# @param buyer_id ID of the buyer.
|
50
|
+
# @param group
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [UserGroup]
|
53
|
+
describe 'create test' do
|
54
|
+
it "should work" do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for delete
|
60
|
+
#
|
61
|
+
#
|
62
|
+
# @param buyer_id ID of the buyer.
|
63
|
+
# @param user_group_id ID of the user group.
|
64
|
+
# @param [Hash] opts the optional parameters
|
65
|
+
# @return [nil]
|
66
|
+
describe 'delete test' do
|
67
|
+
it "should work" do
|
68
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# unit tests for delete_user_assignment
|
73
|
+
#
|
74
|
+
#
|
75
|
+
# @param buyer_id ID of the buyer.
|
76
|
+
# @param user_group_id ID of the user group.
|
77
|
+
# @param user_id ID of the user.
|
78
|
+
# @param [Hash] opts the optional parameters
|
79
|
+
# @return [nil]
|
80
|
+
describe 'delete_user_assignment test' do
|
81
|
+
it "should work" do
|
82
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# unit tests for get
|
87
|
+
#
|
88
|
+
#
|
89
|
+
# @param buyer_id ID of the buyer.
|
90
|
+
# @param user_group_id ID of the user group.
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @return [UserGroup]
|
93
|
+
describe 'get test' do
|
94
|
+
it "should work" do
|
95
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# unit tests for list
|
100
|
+
#
|
101
|
+
#
|
102
|
+
# @param buyer_id ID of the buyer.
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [String] :search Word or phrase to search for.
|
105
|
+
# @option opts [String] :search_on Comma-delimited list of fields to search on.
|
106
|
+
# @option opts [String] :sort_by Comma-delimited list of fields to sort by.
|
107
|
+
# @option opts [Integer] :page Page of results to return. Default: 1
|
108
|
+
# @option opts [Integer] :page_size Number of results to return per page. Default: 20, max: 100.
|
109
|
+
# @option opts [Hash<String, String>] :filters Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
|
110
|
+
# @return [ListUserGroup]
|
111
|
+
describe 'list test' do
|
112
|
+
it "should work" do
|
113
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# unit tests for list_user_assignments
|
118
|
+
#
|
119
|
+
#
|
120
|
+
# @param buyer_id ID of the buyer.
|
121
|
+
# @param [Hash] opts the optional parameters
|
122
|
+
# @option opts [String] :user_group_id ID of the user group.
|
123
|
+
# @option opts [String] :user_id ID of the user.
|
124
|
+
# @option opts [Integer] :page Page of results to return. Default: 1
|
125
|
+
# @option opts [Integer] :page_size Number of results to return per page. Default: 20, max: 100.
|
126
|
+
# @return [ListUserGroupAssignment]
|
127
|
+
describe 'list_user_assignments test' do
|
128
|
+
it "should work" do
|
129
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# unit tests for patch
|
134
|
+
#
|
135
|
+
#
|
136
|
+
# @param buyer_id ID of the buyer.
|
137
|
+
# @param user_group_id ID of the user group.
|
138
|
+
# @param group
|
139
|
+
# @param [Hash] opts the optional parameters
|
140
|
+
# @return [nil]
|
141
|
+
describe 'patch test' do
|
142
|
+
it "should work" do
|
143
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# unit tests for save_user_assignment
|
148
|
+
#
|
149
|
+
#
|
150
|
+
# @param buyer_id ID of the buyer.
|
151
|
+
# @param user_group_assignment
|
152
|
+
# @param [Hash] opts the optional parameters
|
153
|
+
# @return [nil]
|
154
|
+
describe 'save_user_assignment test' do
|
155
|
+
it "should work" do
|
156
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# unit tests for update
|
161
|
+
#
|
162
|
+
#
|
163
|
+
# @param buyer_id ID of the buyer.
|
164
|
+
# @param user_group_id ID of the user group.
|
165
|
+
# @param group
|
166
|
+
# @param [Hash] opts the optional parameters
|
167
|
+
# @return [UserGroup]
|
168
|
+
describe 'update test' do
|
169
|
+
it "should work" do
|
170
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
=begin
|
2
|
+
#OrderCloud
|
3
|
+
|
4
|
+
#A full ecommerce backend as a service.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
Contact: ordercloud@four51.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'spec_helper'
|
25
|
+
|
26
|
+
describe OrderCloud::ApiAuth do
|
27
|
+
let(:valid_client_id) { 'BA89381F-E787-477D-B220-F8A01F0D582A' }
|
28
|
+
let(:valid_username) { 'testo5' }
|
29
|
+
let(:valid_password) { 'testo5' }
|
30
|
+
let(:valid_client_secret) { '' }
|
31
|
+
|
32
|
+
let(:invalid_client_id) { 've1fYQ0NXME13wa5JetO' }
|
33
|
+
let(:invalid_username) { 'invaliduser' }
|
34
|
+
let(:invalid_password) { 'invalidpassword' }
|
35
|
+
let(:invalid_client_secret) { 'L6kzJlz1ewwYYeVozNCs' }
|
36
|
+
|
37
|
+
let(:scopes) { ['FullAccess'] }
|
38
|
+
let(:bad_auth_url) { 'thisshouldnotwork.com' }
|
39
|
+
|
40
|
+
let(:impersonation_token) { '4QAtuGBvK8bj22XdT0H5' }
|
41
|
+
|
42
|
+
let(:config) { OrderCloud::Configuration.default }
|
43
|
+
before(:each) do
|
44
|
+
OrderCloud::Configuration.reset
|
45
|
+
OrderCloud.configure { |c|
|
46
|
+
c.auth_url = "https://auth.ordercloud.io/oauth/token"
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#password_flow' do
|
51
|
+
context 'with valid data' do
|
52
|
+
it 'does not raise error and set an access token' do
|
53
|
+
OrderCloud.configure { |c|
|
54
|
+
c.client_id = valid_client_id
|
55
|
+
c.scopes = scopes
|
56
|
+
}
|
57
|
+
expect{ OrderCloud::ApiAuth::login(valid_username, valid_password)}.to_not raise_error
|
58
|
+
expect(config.access_token).to_not be_nil
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'with invalid id or empty data' do
|
63
|
+
it 'fails if the auth url is invalid' do
|
64
|
+
OrderCloud.configure { |c|
|
65
|
+
c.client_id = valid_client_id
|
66
|
+
c.scopes = scopes
|
67
|
+
c.auth_url = bad_auth_url
|
68
|
+
}
|
69
|
+
expect { OrderCloud::ApiAuth::login(valid_username, valid_password)}.to raise_error(ArgumentError)
|
70
|
+
expect(config.access_token).to be_nil
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'fails if the client id is not provided' do
|
74
|
+
OrderCloud.configure { |c|
|
75
|
+
c.scopes = scopes
|
76
|
+
}
|
77
|
+
expect { OrderCloud::ApiAuth::login(valid_username, valid_password)}.to raise_error(NoMethodError)
|
78
|
+
expect(config.access_token).to be_nil
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'fails if the client id is invalid' do
|
82
|
+
OrderCloud.configure { |c|
|
83
|
+
c.client_id = invalid_client_id
|
84
|
+
c.scopes = scopes
|
85
|
+
}
|
86
|
+
expect { OrderCloud::ApiAuth::login(valid_username, valid_password)}.to raise_error(NoMethodError)
|
87
|
+
expect(config.access_token).to be_nil
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'fails if invalid login/username' do
|
91
|
+
OrderCloud.configure { |c|
|
92
|
+
c.client_id = valid_client_id
|
93
|
+
c.scopes = @scopes
|
94
|
+
}
|
95
|
+
expect { OrderCloud::ApiAuth::login(invalid_username, invalid_password)}.to raise_error(NoMethodError)
|
96
|
+
expect(config.access_token).to be_nil
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe '#client_credentials_flow' do
|
102
|
+
it 'does not raise error and set an access token' do
|
103
|
+
OrderCloud.configure { |c|
|
104
|
+
c.client_id = valid_client_id
|
105
|
+
c.scopes = scopes
|
106
|
+
}
|
107
|
+
expect{ OrderCloud::ApiAuth::authenticate()}.to_not raise_error
|
108
|
+
expect(config.access_token).to_not be_nil
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'fails if the auth url is invalid' do
|
112
|
+
OrderCloud.configure { |c|
|
113
|
+
c.client_id = valid_client_id
|
114
|
+
c.scopes = scopes
|
115
|
+
c.auth_url = bad_auth_url
|
116
|
+
}
|
117
|
+
expect { OrderCloud::ApiAuth::authenticate}.to raise_error(ArgumentError)
|
118
|
+
expect(config.access_token).to be_nil
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'fails if the client id is not provided' do
|
122
|
+
OrderCloud.configure { |c|
|
123
|
+
c.scopes = scopes
|
124
|
+
}
|
125
|
+
expect { OrderCloud::ApiAuth::authenticate}.to raise_error(NoMethodError)
|
126
|
+
expect(config.access_token).to be_nil
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'fails if the client id is invalid' do
|
130
|
+
OrderCloud.configure { |c|
|
131
|
+
c.client_id = invalid_client_id
|
132
|
+
c.scopes = scopes
|
133
|
+
}
|
134
|
+
expect { OrderCloud::ApiAuth::authenticate}.to raise_error(NoMethodError)
|
135
|
+
expect(config.access_token).to be_nil
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
describe '#impersonation' do
|
140
|
+
it 'succeeds when provided a token' do
|
141
|
+
expect{ OrderCloud::ApiAuth.start_impersonate(impersonation_token)}.to_not raise_error
|
142
|
+
expect(config.impersonating?).to be_truthy
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'fails to start if not provided an impersonation token' do
|
146
|
+
expect{ OrderCloud::ApiAuth.start_impersonate(nil)}.to raise_error(ArgumentError)
|
147
|
+
end
|
148
|
+
|
149
|
+
it 'stops impersonating properly' do
|
150
|
+
OrderCloud::ApiAuth.start_impersonate(impersonation_token)
|
151
|
+
expect(config.impersonating?).to be_truthy
|
152
|
+
|
153
|
+
OrderCloud::ApiAuth.stop_impersonate()
|
154
|
+
expect(config.impersonating?).to be_falsey
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'returns the proper access tokens' do
|
158
|
+
OrderCloud::ApiAuth.start_impersonate(impersonation_token)
|
159
|
+
expect(config.get_access_token).to eq(impersonation_token)
|
160
|
+
|
161
|
+
OrderCloud::ApiAuth.stop_impersonate()
|
162
|
+
expect(config.get_access_token).to_not eq(impersonation_token)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,237 @@
|
|
1
|
+
=begin
|
2
|
+
#OrderCloud
|
3
|
+
|
4
|
+
#A full ecommerce backend as a service.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
Contact: ordercloud@four51.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'spec_helper'
|
25
|
+
|
26
|
+
describe OrderCloud::ApiClient do
|
27
|
+
context 'initialization' do
|
28
|
+
context 'URL stuff' do
|
29
|
+
context 'host' do
|
30
|
+
it 'removes http from host' do
|
31
|
+
OrderCloud.configure { |c| c.host = 'http://example.com' }
|
32
|
+
expect(OrderCloud::Configuration.default.host).to eq('example.com')
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'removes https from host' do
|
36
|
+
OrderCloud.configure { |c| c.host = 'https://wookiee.com' }
|
37
|
+
expect(OrderCloud::Configuration.default.host).to eq('wookiee.com')
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'removes trailing path from host' do
|
41
|
+
OrderCloud.configure { |c| c.host = 'hobo.com/v4' }
|
42
|
+
expect(OrderCloud::Configuration.default.host).to eq('hobo.com')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'base_path' do
|
47
|
+
it "prepends a slash to base_path" do
|
48
|
+
OrderCloud.configure { |c| c.base_path = 'v4/dog' }
|
49
|
+
expect(OrderCloud::Configuration.default.base_path).to eq('/v4/dog')
|
50
|
+
end
|
51
|
+
|
52
|
+
it "doesn't prepend a slash if one is already there" do
|
53
|
+
OrderCloud.configure { |c| c.base_path = '/v4/dog' }
|
54
|
+
expect(OrderCloud::Configuration.default.base_path).to eq('/v4/dog')
|
55
|
+
end
|
56
|
+
|
57
|
+
it "ends up as a blank string if nil" do
|
58
|
+
OrderCloud.configure { |c| c.base_path = nil }
|
59
|
+
expect(OrderCloud::Configuration.default.base_path).to eq('')
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe "params_encoding in #build_request" do
|
66
|
+
let(:config) { OrderCloud::Configuration.new }
|
67
|
+
let(:api_client) { OrderCloud::ApiClient.new(config) }
|
68
|
+
|
69
|
+
it "defaults to nil" do
|
70
|
+
expect(OrderCloud::Configuration.default.params_encoding).to eq(nil)
|
71
|
+
expect(config.params_encoding).to eq(nil)
|
72
|
+
|
73
|
+
request = api_client.build_request(:get, '/test')
|
74
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
75
|
+
end
|
76
|
+
|
77
|
+
it "can be customized" do
|
78
|
+
config.params_encoding = :multi
|
79
|
+
request = api_client.build_request(:get, '/test')
|
80
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "timeout in #build_request" do
|
85
|
+
let(:config) { OrderCloud::Configuration.new }
|
86
|
+
let(:api_client) { OrderCloud::ApiClient.new(config) }
|
87
|
+
|
88
|
+
it "defaults to 0" do
|
89
|
+
expect(OrderCloud::Configuration.default.timeout).to eq(0)
|
90
|
+
expect(config.timeout).to eq(0)
|
91
|
+
|
92
|
+
request = api_client.build_request(:get, '/test')
|
93
|
+
expect(request.options[:timeout]).to eq(0)
|
94
|
+
end
|
95
|
+
|
96
|
+
it "can be customized" do
|
97
|
+
config.timeout = 100
|
98
|
+
request = api_client.build_request(:get, '/test')
|
99
|
+
expect(request.options[:timeout]).to eq(100)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "#deserialize" do
|
104
|
+
it "handles Array<Integer>" do
|
105
|
+
api_client = OrderCloud::ApiClient.new
|
106
|
+
headers = {'Content-Type' => 'application/json'}
|
107
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
108
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
109
|
+
expect(data).to be_instance_of(Array)
|
110
|
+
expect(data).to eq([12, 34])
|
111
|
+
end
|
112
|
+
|
113
|
+
it "handles Array<Array<Integer>>" do
|
114
|
+
api_client = OrderCloud::ApiClient.new
|
115
|
+
headers = {'Content-Type' => 'application/json'}
|
116
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
117
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
118
|
+
expect(data).to be_instance_of(Array)
|
119
|
+
expect(data).to eq([[12, 34], [56]])
|
120
|
+
end
|
121
|
+
|
122
|
+
it "handles Hash<String, String>" do
|
123
|
+
api_client = OrderCloud::ApiClient.new
|
124
|
+
headers = {'Content-Type' => 'application/json'}
|
125
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
126
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
127
|
+
expect(data).to be_instance_of(Hash)
|
128
|
+
expect(data).to eq({:message => 'Hello'})
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
describe "#object_to_hash" do
|
133
|
+
it "ignores nils and includes empty arrays" do
|
134
|
+
# uncomment below to test object_to_hash for model
|
135
|
+
#api_client = OrderCloud::ApiClient.new
|
136
|
+
#_model = OrderCloud::ModelName.new
|
137
|
+
# update the model attribute below
|
138
|
+
#_model.id = 1
|
139
|
+
# update the expected value (hash) below
|
140
|
+
#expected = {id: 1, name: '', tags: []}
|
141
|
+
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
describe "#build_collection_param" do
|
146
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
147
|
+
let(:api_client) { OrderCloud::ApiClient.new }
|
148
|
+
|
149
|
+
it "works for csv" do
|
150
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
151
|
+
end
|
152
|
+
|
153
|
+
it "works for ssv" do
|
154
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
155
|
+
end
|
156
|
+
|
157
|
+
it "works for tsv" do
|
158
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
159
|
+
end
|
160
|
+
|
161
|
+
it "works for pipes" do
|
162
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
163
|
+
end
|
164
|
+
|
165
|
+
it "works for multi" do
|
166
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
167
|
+
end
|
168
|
+
|
169
|
+
it "fails for invalid collection format" do
|
170
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
describe "#json_mime?" do
|
175
|
+
let(:api_client) { OrderCloud::ApiClient.new }
|
176
|
+
|
177
|
+
it "works" do
|
178
|
+
expect(api_client.json_mime?(nil)).to eq false
|
179
|
+
expect(api_client.json_mime?('')).to eq false
|
180
|
+
|
181
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
182
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
183
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
184
|
+
|
185
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
186
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
187
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
describe "#select_header_accept" do
|
192
|
+
let(:api_client) { OrderCloud::ApiClient.new }
|
193
|
+
|
194
|
+
it "works" do
|
195
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
196
|
+
expect(api_client.select_header_accept([])).to be_nil
|
197
|
+
|
198
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
199
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
200
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
201
|
+
|
202
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
203
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
describe "#select_header_content_type" do
|
208
|
+
let(:api_client) { OrderCloud::ApiClient.new }
|
209
|
+
|
210
|
+
it "works" do
|
211
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
212
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
213
|
+
|
214
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
215
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
216
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
217
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
218
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
describe "#sanitize_filename" do
|
223
|
+
let(:api_client) { OrderCloud::ApiClient.new }
|
224
|
+
|
225
|
+
it "works" do
|
226
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
227
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
228
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
229
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
230
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
231
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
232
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
233
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
234
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|