Browse Source

Merge pull request #247 from Shopify/tax_services

Add tax service files
Andrew Paliga 9 years ago
parent
commit
03a4cc6277

+ 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