Sha256: 6a78e0e036d6de643e7d34cfcae3be6cb551b9ffeb3237e0f44362451ed6e415
Contents?: true
Size: 1.16 KB
Versions: 34
Compression:
Stored size: 1.16 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, new_rates: [{ percentage: 0.07 }] } 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
34 entries across 34 versions & 1 rubygems