From b578cdcfa8ddc8be80b30c4ac218be639d9d430e Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Mon, 23 Apr 2018 10:27:44 +0300 Subject: [PATCH] Cleanup setup/teardown methods --- test/integration/registrar/invoices/list_test.rb | 4 +++- .../registrar/invoices/new_invoice_payment_test.rb | 4 +++- test/integration/registrar/invoices/new_test.rb | 4 +++- .../registrar/invoices/payment_callback_test.rb | 4 +++- .../integration/registrar/invoices/payment_return_test.rb | 4 +++- test/models/payments/bank_link_test.rb | 1 + test/models/payments/every_pay_test.rb | 8 ++++++-- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/test/integration/registrar/invoices/list_test.rb b/test/integration/registrar/invoices/list_test.rb index b5a61af5b..45e7d5f8b 100644 --- a/test/integration/registrar/invoices/list_test.rb +++ b/test/integration/registrar/invoices/list_test.rb @@ -1,7 +1,9 @@ require 'test_helper' class ListInvoicesTest < ActionDispatch::IntegrationTest - setup do + def setup + super + @user = users(:api_bestnames) @registrar_invoices = @user.registrar.invoices login_as @user diff --git a/test/integration/registrar/invoices/new_invoice_payment_test.rb b/test/integration/registrar/invoices/new_invoice_payment_test.rb index f12445157..995379edc 100644 --- a/test/integration/registrar/invoices/new_invoice_payment_test.rb +++ b/test/integration/registrar/invoices/new_invoice_payment_test.rb @@ -1,7 +1,9 @@ require 'test_helper' class NewInvoicePaymentTest < ActionDispatch::IntegrationTest - setup do + def setup + super + @user = users(:api_bestnames) login_as @user end diff --git a/test/integration/registrar/invoices/new_test.rb b/test/integration/registrar/invoices/new_test.rb index 35957dddc..738e06d3c 100644 --- a/test/integration/registrar/invoices/new_test.rb +++ b/test/integration/registrar/invoices/new_test.rb @@ -1,7 +1,9 @@ require 'test_helper' class NewInvoiceTest < ActionDispatch::IntegrationTest - setup do + def setup + super + @user = users(:api_bestnames) login_as @user end diff --git a/test/integration/registrar/invoices/payment_callback_test.rb b/test/integration/registrar/invoices/payment_callback_test.rb index b341168d8..9e8996214 100644 --- a/test/integration/registrar/invoices/payment_callback_test.rb +++ b/test/integration/registrar/invoices/payment_callback_test.rb @@ -1,7 +1,9 @@ require 'test_helper' class PaymentCallbackTest < ActionDispatch::IntegrationTest - setup do + def setup + super + @user = users(:api_bestnames) login_as @user end diff --git a/test/integration/registrar/invoices/payment_return_test.rb b/test/integration/registrar/invoices/payment_return_test.rb index 9bb6e9b63..4524dc1ef 100644 --- a/test/integration/registrar/invoices/payment_return_test.rb +++ b/test/integration/registrar/invoices/payment_return_test.rb @@ -1,7 +1,9 @@ require 'test_helper' class PaymentReturnTest < ActionDispatch::IntegrationTest - setup do + def setup + super + @user = users(:api_bestnames) login_as @user end diff --git a/test/models/payments/bank_link_test.rb b/test/models/payments/bank_link_test.rb index e03b540df..6c2a86b80 100644 --- a/test/models/payments/bank_link_test.rb +++ b/test/models/payments/bank_link_test.rb @@ -21,6 +21,7 @@ class BankLinkTest < ActiveSupport::TestCase def teardown super + travel_back end diff --git a/test/models/payments/every_pay_test.rb b/test/models/payments/every_pay_test.rb index 74e8f5346..a49a5a639 100644 --- a/test/models/payments/every_pay_test.rb +++ b/test/models/payments/every_pay_test.rb @@ -1,7 +1,9 @@ require 'test_helper' class EveryPayTest < ActiveSupport::TestCase - setup do + def setup + super + @invoice = invoices(:for_payments_test) invoice_item = invoice_items(:one) @@ -40,7 +42,9 @@ class EveryPayTest < ActiveSupport::TestCase travel_to Time.at(1522542600) end - teardown do + def teardown + super + travel_back end