Initial commit
This commit is contained in:
14
spec/factories/account.rb
Normal file
14
spec/factories/account.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# encoding: UTF-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AccountFactory
|
||||
def create_account(*arguments)
|
||||
currency = Symbol === arguments.first ? arguments.first : :usd
|
||||
attributes = arguments.extract_options!
|
||||
attributes.delete(:member) { create(:member) }.get_account(currency).tap do |account|
|
||||
account.update!(attributes)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure { |config| config.include AccountFactory }
|
||||
Reference in New Issue
Block a user