Add set_balance_as_sum and wait_with_text to BankAccountConnector
This commit is contained in:
parent
3f25138997
commit
75129b52c6
3 changed files with 15 additions and 6 deletions
|
|
@ -96,14 +96,18 @@ class BankAccountConnector
|
|||
@controls += [TextItem.new(data)]
|
||||
end
|
||||
|
||||
def wait_with_text(auto_submit, data)
|
||||
def confirm_text(code)
|
||||
text t('.confirm', code: code)
|
||||
end
|
||||
|
||||
def wait_with_text(auto_submit, code)
|
||||
@auto_submit = auto_submit
|
||||
@controls += [TextItem.new(data)]
|
||||
confirm_text code
|
||||
end
|
||||
|
||||
def wait_for_app(code)
|
||||
hidden_field :twofactor, code
|
||||
wait_with_text 3000, t('.confirm_app', code: code)
|
||||
wait_with_text 3000, code
|
||||
nil
|
||||
end
|
||||
|
||||
|
|
@ -119,11 +123,14 @@ class BankAccountConnector
|
|||
@controls += [PasswordField.new(name, value, t(name))]
|
||||
end
|
||||
|
||||
|
||||
def set_balance(amount)
|
||||
@bank_account.balance = amount
|
||||
end
|
||||
|
||||
def set_balance_as_sum
|
||||
@bank_account.balance = @bank_account.bank_transactions.sum(:amount)
|
||||
end
|
||||
|
||||
def continuation_point
|
||||
@bank_account.import_continuation_point
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue