Update VAT

#623
This commit is contained in:
Artur Beljajev 2017-11-27 11:11:06 +02:00
parent c47ca77ca6
commit 6a01226138
8 changed files with 126 additions and 20 deletions

View file

@ -0,0 +1,19 @@
require 'test_helper'
class InvoiceDetailsTest < ActionDispatch::IntegrationTest
def setup
login_as users(:admin)
end
def test_with_vat
invoice = invoices(:with_vat)
visit admin_invoice_path(invoice)
assert_selector '.total', text: 'VAT'
end
def test_without_vat
invoice = invoices(:without_vat)
visit admin_invoice_path(invoice)
assert_no_selector '.total', text: 'VAT'
end
end

View file

@ -17,7 +17,7 @@ class ShowRegistrarTest < ActionDispatch::IntegrationTest
assert_text 'Language English'
end
def test_vat_number
def test_vat_no
assert_text 'US12345'
end

View file

@ -0,0 +1,19 @@
require 'test_helper'
class InvoiceDetailsTest < ActionDispatch::IntegrationTest
def setup
login_as users(:api)
end
def test_with_vat
invoice = invoices(:with_vat)
visit registrar_invoice_path(invoice)
assert_selector '.total', text: 'VAT'
end
def test_without_vat
invoice = invoices(:without_vat)
visit registrar_invoice_path(invoice)
assert_no_selector '.total', text: 'VAT'
end
end