mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Implement code review changes
This commit is contained in:
parent
b56fd73c92
commit
e1149bf92b
3 changed files with 6 additions and 23 deletions
|
@ -26,24 +26,8 @@ module Payments
|
|||
transaction.save!
|
||||
end
|
||||
|
||||
def complete_transaction
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def settled_payment?
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def form_fields
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def form_url
|
||||
ENV["payments_#{type}_url"]
|
||||
end
|
||||
|
||||
def valid_response?
|
||||
raise NotImplementedError
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,8 +38,7 @@ class EveryPayTest < ActiveSupport::TestCase
|
|||
@every_pay = Payments::EveryPay.new('every_pay', @invoice, params)
|
||||
@other_pay = Payments::EveryPay.new('every_pay', @invoice, {})
|
||||
|
||||
# To avoid problems with time conversion.
|
||||
travel_to Time.at(1522542600)
|
||||
travel_to Time.zone.parse('2018-04-01 00:30:00 +0000')
|
||||
end
|
||||
|
||||
def teardown
|
||||
|
|
|
@ -27,20 +27,20 @@ class PaymentTest < ActiveSupport::TestCase
|
|||
assert_nil @not_implemented_payment.form_url
|
||||
end
|
||||
|
||||
def test_that_errors_are_raised_on_not_implemented_methods
|
||||
assert_raise NotImplementedError do
|
||||
def test_that_errors_are_raised_on_missing_methods
|
||||
assert_raise NoMethodError do
|
||||
@not_implemented_payment.valid_response?
|
||||
end
|
||||
|
||||
assert_raise NotImplementedError do
|
||||
assert_raise NoMethodError do
|
||||
@not_implemented_payment.settled_payment?
|
||||
end
|
||||
|
||||
assert_raise NotImplementedError do
|
||||
assert_raise NoMethodError do
|
||||
@not_implemented_payment.form_fields
|
||||
end
|
||||
|
||||
assert_raise NotImplementedError do
|
||||
assert_raise NoMethodError do
|
||||
@not_implemented_payment.complete_transaction
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue