Remove unused db column

This commit is contained in:
Artur Beljajev 2019-08-11 22:02:19 +03:00
parent d34e6430a2
commit 5a68035818
5 changed files with 20 additions and 31 deletions

View file

@ -3,10 +3,9 @@ require 'test_helper'
class ListInvoicesTest < ApplicationSystemTestCase
setup do
@user = users(:api_bestnames)
sign_in @user
@invoice = invoices(:one)
eliminate_effect_of_other_invoices
sign_in @user
end
def test_show_balance
@ -14,31 +13,23 @@ class ListInvoicesTest < ApplicationSystemTestCase
assert_text "Your current account balance is 100,00 EUR"
end
def test_show_invoices_of_current_registrar
registrar = registrars(:bestnames)
@user.update!(registrar: registrar)
@invoice.update!(seller: registrar)
def test_shows_invoice_owned_by_current_user
owning_registrar = registrars(:bestnames)
assert_equal owning_registrar, @user.registrar
@invoice.update!(buyer: owning_registrar)
visit registrar_invoices_url
assert_css '.invoice'
assert_text @invoice.to_s
end
def test_do_not_show_invoices_of_other_registrars
registrar = registrars(:goodnames)
@user.update!(registrar: registrar)
@invoice.update!(seller: registrar)
def test_hides_invoice_owned_by_other_user
other_registrar = registrars(:goodnames)
assert_not_equal other_registrar, @user.registrar
@invoice.update!(buyer: other_registrar)
visit registrar_invoices_url
assert_no_css '.invoice'
end
private
def eliminate_effect_of_other_invoices
Invoice.connection.disable_referential_integrity do
Invoice.delete_all("id != #{@invoice.id}")
end
assert_no_text @invoice.to_s
end
end