Sha256: 88ed69b9df40089942b2f3ddc33215fcb270dbe8f5cc8488c1be71646a16ee76

Contents?: true

Size: 1.13 KB

Versions: 28

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class TaxCategoriesIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      setup :set_tax_category

      def set_tax_category
        @tax_category = {
            name: 'Tax Category',
            code: '001'
          }
      end

      def test_creates_a_new_tax_category
        post admin.tax_categories_path,
          params: { category: @tax_category }

        assert_equal(1, Tax::Category.count)

        category = Tax::Category.first
        assert_equal('Tax Category', category.name)
        assert_equal('001', category.code)
      end

      def test_updates_a_tax_category
        category = create_tax_category(name: "test tax")
        patch admin.tax_category_path(category),
          params: { category: { name: 'foo bar'} }

        assert_equal(1, Tax::Category.count)
        assert_equal('foo bar', Tax::Category.first.name)
      end

      def test_deletes_a_tax_category
        category = create_tax_category
        delete admin.tax_category_path(category)
        assert_equal(0, Tax::Category.count)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-admin-3.5.6 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.5 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.4 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.3 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.2 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.1 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.0 test/integration/workarea/admin/tax_categories_integration_test.rb
workarea-admin-3.5.0.beta.1 test/integration/workarea/admin/tax_categories_integration_test.rb