mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Prepare fixture data for account sync tests (#493)
* Rename account balance field for clarity `original_balance` and `original_currency` may infer that these values are "original" to the account. In reality, they represent the "current" balance and currency on the account. * Prepare fixture data for account sync testing * Update to new field * Fix conflicts * Remove local schema change
This commit is contained in:
@@ -2,8 +2,9 @@ require "test_helper"
|
||||
|
||||
class AccountTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
depository = Account::Depository.create!
|
||||
@account = Account.create!(family: families(:dylan_family), name: "Explicit Checking", original_balance: 1200, accountable: depository)
|
||||
depository = account_depositories(:checking)
|
||||
@account = accounts(:checking)
|
||||
@account.accountable = depository
|
||||
end
|
||||
|
||||
test "new account should be valid" do
|
||||
|
||||
@@ -2,7 +2,7 @@ require "test_helper"
|
||||
|
||||
class CurrentTest < ActiveSupport::TestCase
|
||||
test "family returns user family" do
|
||||
user = users(:bob)
|
||||
user = users(:family_admin)
|
||||
Current.user = user
|
||||
assert_equal user.family, Current.family
|
||||
end
|
||||
|
||||
@@ -6,12 +6,12 @@ class FamilyTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "should have many users" do
|
||||
assert_equal 2, @dylan_family.users.size
|
||||
assert @dylan_family.users.include?(users(:bob))
|
||||
assert @dylan_family.users.size > 0
|
||||
assert @dylan_family.users.include?(users(:family_admin))
|
||||
end
|
||||
|
||||
test "should have many accounts" do
|
||||
assert_equal 2, @dylan_family.accounts.size
|
||||
assert @dylan_family.accounts.size > 0
|
||||
end
|
||||
|
||||
test "should destroy dependent users" do
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
require "test_helper"
|
||||
|
||||
class TransactionTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ require "test_helper"
|
||||
|
||||
class UserTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@user = users(:bob)
|
||||
@user = users(:family_admin)
|
||||
end
|
||||
|
||||
test "should be valid" do
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
require "test_helper"
|
||||
|
||||
class ValuationTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user