mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +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!
|
transaction.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
def complete_transaction
|
|
||||||
raise NotImplementedError
|
|
||||||
end
|
|
||||||
|
|
||||||
def settled_payment?
|
|
||||||
raise NotImplementedError
|
|
||||||
end
|
|
||||||
|
|
||||||
def form_fields
|
|
||||||
raise NotImplementedError
|
|
||||||
end
|
|
||||||
|
|
||||||
def form_url
|
def form_url
|
||||||
ENV["payments_#{type}_url"]
|
ENV["payments_#{type}_url"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_response?
|
|
||||||
raise NotImplementedError
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,8 +38,7 @@ class EveryPayTest < ActiveSupport::TestCase
|
||||||
@every_pay = Payments::EveryPay.new('every_pay', @invoice, params)
|
@every_pay = Payments::EveryPay.new('every_pay', @invoice, params)
|
||||||
@other_pay = Payments::EveryPay.new('every_pay', @invoice, {})
|
@other_pay = Payments::EveryPay.new('every_pay', @invoice, {})
|
||||||
|
|
||||||
# To avoid problems with time conversion.
|
travel_to Time.zone.parse('2018-04-01 00:30:00 +0000')
|
||||||
travel_to Time.at(1522542600)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
|
|
|
@ -27,20 +27,20 @@ class PaymentTest < ActiveSupport::TestCase
|
||||||
assert_nil @not_implemented_payment.form_url
|
assert_nil @not_implemented_payment.form_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_that_errors_are_raised_on_not_implemented_methods
|
def test_that_errors_are_raised_on_missing_methods
|
||||||
assert_raise NotImplementedError do
|
assert_raise NoMethodError do
|
||||||
@not_implemented_payment.valid_response?
|
@not_implemented_payment.valid_response?
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise NotImplementedError do
|
assert_raise NoMethodError do
|
||||||
@not_implemented_payment.settled_payment?
|
@not_implemented_payment.settled_payment?
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise NotImplementedError do
|
assert_raise NoMethodError do
|
||||||
@not_implemented_payment.form_fields
|
@not_implemented_payment.form_fields
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise NotImplementedError do
|
assert_raise NoMethodError do
|
||||||
@not_implemented_payment.complete_transaction
|
@not_implemented_payment.complete_transaction
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue