فهرست منبع

add tax service files

Andrew P 9 سال پیش
والد
کامیت
c40b37677f
3فایلهای تغییر یافته به همراه21 افزوده شده و 0 حذف شده
  1. 4 0
      lib/shopify_api/resources/tax_service.rb
  2. 9 0
      test/fixtures/tax_service.json
  3. 8 0
      test/tax_service_test.rb

+ 4 - 0
lib/shopify_api/resources/tax_service.rb

@@ -0,0 +1,4 @@
+module ShopifyAPI
+  class TaxService < Base
+  end
+end

+ 9 - 0
test/fixtures/tax_service.json

@@ -0,0 +1,9 @@
+{
+  "tax_service": {
+    "name": "My Tax Service",
+    "url": "https://mytaxservice.com",
+    "id": 123456,
+    "default_tax_code": "TX123",
+    "active": "true"
+  }
+}

+ 8 - 0
test/tax_service_test.rb

@@ -0,0 +1,8 @@
+require 'test_helper'
+class TaxServiceTest < Test::Unit::TestCase
+  test "tax service creation" do
+    fake "tax_services", :method => :post, :status => 202, :body => load_fixture('tax_service')
+    tax_service = ShopifyAPI::TaxService.create(:name => "My Tax Service", :url => "https://mytaxservice.com")
+    assert_equal '{"tax_service":{"name":"My Tax Service","url":"https://mytaxservice.com"}}', FakeWeb.last_request.body
+  end
+end